Skip to content

Commit

Permalink
Updated to use the_content filter
Browse files Browse the repository at this point in the history
Now uses the_content filter
  • Loading branch information
Lewiscowles1986 committed Dec 13, 2015
1 parent 9af4d9b commit 4b9dd2f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
Plugin URI: http://www.codesign2.co.uk
Description: Bring your content authoring and tooling into the 21st century with this tool for all CODESIGN2 customers. NOT FOR RESALE BUNDLED OR STANDALONE FOR ANY REASON
Author: CODESIGN2
Version: 2.6
Version: 2.6.2
Author URI: http://www.codesign2.co.uk/
License: AGPL
*/

new cd2_content_sectionCPTClass();

/**
* The Class.
*/
Expand All @@ -28,7 +30,7 @@ public function init() {
}

public function ajax_content_section() {
$name = isset( $_GET['name'] ) ? base64_decode( $_GET['name'] ) : 'invalid';
$name = isset( $_GET['name'] ) ? urldecode( $_GET['name'] ) : 'invalid';
die(
json_encode(
[
Expand Down Expand Up @@ -56,7 +58,7 @@ public function ajax_content_sections() {
'ID' => get_the_ID(),
'title' => get_the_title(),
'author' => get_the_author(),
'content' => get_the_content(),
'content' => apply_filters( 'the_content', get_the_content() ),
'thumbnail' => wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ),
];
}
Expand Down Expand Up @@ -86,7 +88,7 @@ public function render_sc( $atts, $content='', $tag=self::POST_TYPE ) {
$atts
); // Ensure that attributes exist
$slug = sanitize_title( $atts_named[ 'name' ] );
$out = '<!-- CD2 content section shortcode used here for "' . $atts_named[ 'name' ] . '" translated to "' . $slug . '" -->';
$out = '';//<!-- CD2 content section shortcode used here for "' . $atts_named[ 'name' ] . '" translated to "' . $slug . '" -->';
$args = [
'post_type' => self::POST_TYPE,
'name' => $slug
Expand All @@ -97,7 +99,7 @@ public function render_sc( $atts, $content='', $tag=self::POST_TYPE ) {
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
$out .= do_shortcode( get_the_content() );
$out .= do_shortcode( apply_filters( 'the_content', get_the_content() ) );
}
}
wp_reset_query();
Expand Down Expand Up @@ -161,4 +163,3 @@ public function register_post_type() {
);
}
}
new cd2_content_sectionCPTClass();

0 comments on commit 4b9dd2f

Please sign in to comment.