Ticket #5021: 5021.02.patch
File 5021.02.patch, 1.8 KB (added by , 11 years ago) |
---|
-
bp-core/bp-core-template-loader.php
function bp_get_template_stack() { 202 202 function bp_buffer_template_part( $slug, $name = null, $echo = true ) { 203 203 ob_start(); 204 204 205 // Remove 'bp_replace_the_content' filter to prevent infinite loops206 remove_filter( 'the_content', 'bp_replace_the_content' );207 208 205 bp_get_template_part( $slug, $name ); 209 206 210 // Remove 'bp_replace_the_content' filter to prevent infinite loops211 add_filter( 'the_content', 'bp_replace_the_content' );212 213 207 // Get the output buffer contents 214 208 $output = ob_get_contents(); 215 209 -
bp-core/bp-core-theme-compatibility.php
function bp_template_include_theme_compat( $template = '' ) { 521 521 */ 522 522 if ( bp_is_theme_compat_active() ) { 523 523 524 // Remove all filters from the_content 525 bp_remove_all_filters( 'the_content' ); 526 527 // Add a filter on the_content late, which we will later remove 528 if ( ! has_filter( 'the_content', 'bp_replace_the_content' ) ) { 524 // Remove all filters from 'the_content' after the_post() is called 525 // This is the latest we can run this before we do our object buffering 526 add_action( 'loop_start', create_function( '', " 527 bp_remove_all_filters( 'the_content' ); 529 528 add_filter( 'the_content', 'bp_replace_the_content' ); 530 } 529 " ), 9999 ); 530 531 // Restore the filters after the post loop is finished 532 add_action( 'loop_end', create_function( '', " 533 bp_restore_all_filters( 'the_content' ); 534 " ), 0 ); 531 535 532 536 // Add BuddyPress's head action to wp_head 533 537 if ( ! has_action( 'wp_head', 'bp_head' ) ) {