bp_legacy_theme_ajax_querystring

Filters the AJAX query string for the component loops.

Description

apply_filters( 'bp_legacy_theme_ajax_querystring', (string) $query_string, (string) $object, (string) $object_filter, (string) $object_scope, (string) $object_page, (string) $object_search_terms, (string) $object_extras ); 

Parameters (7)

0. $query_string (string)
The query string we are working with.
1. $object (string)
The type of page we are on.
2. $object_filter (string)
The current object filter.
3. $object_scope (string)
The current object scope.
4. $object_page (string)
The current object page.
5. $object_search_terms (string)
The current object search terms.
6. $object_extras (string)
The current object extras.

Usage

To run the hook, copy the example below.
  1. $query_string = apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras ); 
  2.  
  3. if ( !empty( $query_string ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_legacy_theme_ajax_querystring callback 
  2. function filter_bp_legacy_theme_ajax_querystring( $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras ) { 
  3. // make filter magic happen here... 
  4. return $query_string
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_legacy_theme_ajax_querystring', 'filter_bp_legacy_theme_ajax_querystring', 10, 7 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_legacy_theme_ajax_querystring', 'filter_bp_legacy_theme_ajax_querystring', 10, 7 ); 

Defined (1)

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

/bp-templates/bp-legacy/buddypress-functions.php  
  1. return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );