WordPress at a glance
filter is not described

posts_clauses filter-hook . WP 3.1.0

Filters all query clauses at once, for convenience.

Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT, fields (SELECT), and LIMITS clauses.


add_filter( 'posts_clauses', 'filter_function_name_9008', 10, 2 );
function filter_function_name_9008( $clauses, $this ){
	// filter...

	return $clauses;
Associative array of the clauses for the query.
The WP_Query instance (passed by reference).


Since 3.1.0 Introduced.

Where the hook is called

wp-includes/class-wp-query.php 2773
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );

Where in WP core the hook is used WordPress

wp-includes/class-wp-query.php 2978
add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
wp-includes/class-wp-query.php 1272
add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
wp-includes/class-wp-query.php 7481
remove_filter( 'posts_clauses', __FUNCTION__ );
wp-includes/class-wp-query.php 92
add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );