query
Filters the database query.
Description
Parameters (1)
- 0. $query (unknown)
- The query.
Usage
- To run the hook, copy the example below.
- $query = apply_filters( 'query', $query );
- if ( !empty( $query ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the query callback
- function filter_query( $query ) {
- // make filter magic happen here...
- return $query;
- };
- // add the filter
- add_filter( 'query', 'filter_query', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'query', 'filter_query', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/backpress/class.bpdb.php
- $query = apply_filters( 'query', $query );