Ticket #5021: 5021.4.patch
File 5021.4.patch, 1.4 KB (added by , 12 years ago) |
---|
-
bp-core/bp-core-theme-compatibility.php
function bp_theme_compat_main_loop_start() { 592 592 if ( ! in_the_loop() ) 593 593 return; 594 594 595 // Bail if we've already run BP's injection 596 if ( ! empty( buddypress()->theme_compat->runonce ) ) 597 return; 598 599 global $wp_query; 600 601 // Bail if there is more than one post in this loop, our page injection means 602 // there is only one post in the loop 603 if ( $wp_query->post_count > 1 ) 604 return; 605 595 606 // Remove all of the filters from the_content 596 607 bp_remove_all_filters( 'the_content' ); 597 608 598 609 // Make sure we replace the content 599 610 add_filter( 'the_content', 'bp_replace_the_content' ); 611 612 // Note that we've run our injection 613 buddypress()->theme_compat->runonce = 1; 600 614 } 601 615 602 616 /** … … function bp_theme_compat_main_loop_start() { 610 624 */ 611 625 function bp_theme_compat_main_loop_end() { 612 626 613 // Bail if not the main query614 if ( ! in_the_loop() )627 // Bail if we haven't run BP's content injection yet 628 if ( empty( buddypress()->theme_compat->runonce ) ) 615 629 return; 616 630 617 631 // Put all the filters back 618 632 bp_restore_all_filters( 'the_content' ); 633 634 // Remove our marker 635 unset( buddypress()->theme_compat->runonce ); 619 636 } 620 637 621 638 /** Filters *******************************************************************/