query
Filters the database query.
Some queries are made before the plugins have been loaded, and thus cannot be filtered with this method.
Usage
add_filter( 'query', 'wp_kama_query_filter' );
/**
* Function for `query` filter-hook.
*
* @param string $query Database query.
*
* @return string
*/
function wp_kama_query_filter( $query ){
// filter...
return $query;
}
- $query(string)
- Database query.
Changelog
| Since 2.1.0 | Introduced. |
Where the hook is called
query
wp-includes/class-wpdb.php 2234
$query = apply_filters( 'query', $query );
Where the hook is used in WordPress
wp-includes/class-wpdb.php 2432
add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );