buddyboss_global_search_override_wp_native_results

Force native wp search section to load page template so we can hook stuff into it.

Description

buddyboss_global_search_override_wp_native_results( (mixed) $template ); 

Parameters (1)

0. $template (mixed)
The template.

Usage

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

Defined (1)

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

/includes/filters.php  
  1. function buddyboss_global_search_override_wp_native_results($template) { 
  2.  
  3. if ( is_search() ) { //if search page. 
  4.  
  5.  
  6. $live_template = locate_template( array( 'buddyboss-global-search.php' , 'page.php', 'single.php', 'index.php' ) ); 
  7.  
  8. if ( '' != $live_template ) { 
  9. return $live_template; 
  10.  
  11.  
  12. return $template;