query_string

Filters the query string before parsing.

Description

apply_filters( 'query_string', (string) $this_query_string ); 

Parameters (1)

0. $this_query_string (string)
The query string to modify.

Usage

To run the hook, copy the example below.
  1. $this_query_string = apply_filters( 'query_string', $this_query_string ); 
  2.  
  3. if ( !empty( $this_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 query_string callback 
  2. function filter_query_string( $this_query_string ) { 
  3. // make filter magic happen here... 
  4. return $this_query_string
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'query_string', 'filter_query_string', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'query_string', 'filter_query_string', 10, 1 ); 

Defined (1)

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

/wp-includes/class-wp.php  
  1. $this->query_string = apply_filters( 'query_string', $this->query_string );