buddyboss_global_search_search_page_content

The BuddyPress Global Search buddyboss global search page content function.

Description

buddyboss_global_search_search_page_content( $content ); 

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'buddyboss_global_search_search_page_content' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-global-search/includes/template.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = buddyboss_global_search_search_page_content($content); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/template.php  
  1. function buddyboss_global_search_search_page_content( $content ) { 
  2. /** 
  3. * Reportedly, on some installations, the remove_filter call below, doesn't work and this filter is called over and over again. 
  4. * Possibly due to some other plugin/theme. 
  5. *  
  6. * Lets add another precautionary measure, a global flag. 
  7. * @since 1.1.3 
  8. */ 
  9. global $bpgs_main_content_filter_has_run; 
  10.  
  11. if( !is_admin() && is_search() && 'yes' != $bpgs_main_content_filter_has_run ) { 
  12. remove_filter( 'the_content', 'buddyboss_global_search_search_page_content', 9 ); 
  13. $bpgs_main_content_filter_has_run = 'yes'; 
  14. //setup search resutls and all.. 
  15. buddyboss_global_search()->search->prepare_search_page(); 
  16. $content .= buddyboss_global_search_buffer_template_part( 'results-page', '', false ); 
  17.  
  18. return $content;