Skip to:
Content

bbPress.org

Changeset 3942


Ignore:
Timestamp:
06/08/2012 10:18:22 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Theme Compatibility:

  • Fix issues with 'the_content' and bbp_replace_the_content() causing infinite loops, duplicate filters, no filters, etc...
  • Add 'the_content' adds/removes to BBP_Shortcode where needed.
  • Remove unneeded calls to do_shortcode().
  • Fixes #1844.
Location:
branches/plugin/bbp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-shortcodes.php

    r3930 r3942  
    173173        bbp_set_query_name( $query_name );
    174174
     175        // Remove 'bbp_replace_the_content' filter to prevent infinite loops
     176        remove_filter( 'the_content', 'bbp_replace_the_content' );
     177
    175178        // Start output buffer
    176179        ob_start();
     
    198201        // Reset the query name
    199202        bbp_reset_query_name();
     203
     204        // Add 'bbp_replace_the_content' filter back (@see $this::start())
     205        add_filter( 'the_content', 'bbp_replace_the_content' );
    200206
    201207        return $output;
  • branches/plugin/bbp-includes/bbp-theme-compatibility.php

    r3929 r3942  
    607607    $new_content = '';
    608608
    609     // Remove the filter that was added in bbp_template_include()
    610     remove_filter( 'the_content', 'bbp_replace_the_content' );
    611 
    612609    // Bail if shortcodes are unset somehow
    613610    if ( !is_a( $bbp->shortcodes, 'BBP_Shortcodes' ) )
     
    652649        if ( !empty( $page ) ) {
    653650
     651            // Restore previously unset filters
     652            bbp_restore_all_filters( 'the_content' );
     653
     654            // Remove 'bbp_replace_the_content' filter to prevent infinite loops
     655            remove_filter( 'the_content', 'bbp_replace_the_content' );
     656
    654657            // Start output buffer
    655658            ob_start();
    656659
    657             // Restore previously unset filters
    658             bbp_restore_all_filters( 'the_content' );
    659 
    660660            // Grab the content of this page
    661             $new_content = do_shortcode( apply_filters( 'the_content', get_post_field( 'post_content', $page->ID ) ) );
     661            $new_content = apply_filters( 'the_content', $page->post_content );
    662662
    663663            // Clean up the buffer
    664664            ob_end_clean();
     665
     666            // Add 'bbp_replace_the_content' filter back (@see $this::start())
     667            add_filter( 'the_content', 'bbp_replace_the_content' );
    665668
    666669        // No page so show the archive
     
    678681        if ( !empty( $page ) ) {
    679682
     683            // Restore previously unset filters
     684            bbp_restore_all_filters( 'the_content' );
     685
     686            // Remove 'bbp_replace_the_content' filter to prevent infinite loops
     687            remove_filter( 'the_content', 'bbp_replace_the_content' );
     688
    680689            // Start output buffer
    681690            ob_start();
    682691
    683             // Restore previously unset filters
    684             bbp_restore_all_filters( 'the_content' );
    685 
    686692            // Grab the content of this page
    687             $new_content = do_shortcode( apply_filters( 'the_content', get_post_field( 'post_content', $page->ID ) ) );
     693            $new_content = apply_filters( 'the_content', $page->post_content );
    688694
    689695            // Clean up the buffer
    690696            ob_end_clean();
    691697
     698            // Add 'bbp_replace_the_content' filter back (@see $this::start())
     699            add_filter( 'the_content', 'bbp_replace_the_content' );
    692700
    693701        // No page so show the archive
Note: See TracChangeset for help on using the changeset viewer.