WordPress at a glance
filter is not described

query filter-hook . WP 2.1.0

Filters the database query.

Some queries are made before the plugins have been loaded, and thus cannot be filtered with this method.


add_filter( 'query', 'filter_function_name_7470' );
function filter_function_name_7470( $query ){
	// filter...

	return $query;
Database query.

Where the hook is called

wp-includes/wp-db.php 1871
$query = apply_filters( 'query', $query );

Where the hook is used (in WP core)

wp-includes/wp-db.php 2047
add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );