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.

Usage

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

	return $query;
}
$query(string)
Database query.

Where the hook is called

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

Where the hook is used (in WP core)

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