buddyboss_global_search_clear_native_search_query

The BuddyPress Global Search buddyboss global search clear native query function.

Description

buddyboss_global_search_clear_native_search_query( $query ); 

Parameters (1)

0. $query
The query.

Usage

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

Defined (1)

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

/includes/filters.php  
  1. function buddyboss_global_search_clear_native_search_query($query) { 
  2.  
  3. if ($query->is_search && !is_admin() ) { 
  4.  
  5. remove_filter('pre_get_posts', 'buddyboss_global_search_clear_native_search_query'); //only do first time 
  6.  
  7.  
  8. return $query;