posts_distinct_request filter-hookWP 2.5.0

Filters the DISTINCT clause of the query.

For use by caching plugins.

Usage

add_filter( 'posts_distinct_request', 'wp_kama_posts_distinct_request_filter', 10, 2 );

/**
 * Function for `posts_distinct_request` filter-hook.
 * 
 * @param string   $distinct The DISTINCT clause of the query.
 * @param WP_Query $query    The WP_Query instance (passed by reference).
 *
 * @return string
 */
function wp_kama_posts_distinct_request_filter( $distinct, $query ){

	// filter...
	return $distinct;
}
$distinct(string)
The DISTINCT clause of the query.
$query(WP_Query)
The WP_Query instance (passed by reference).

Changelog

Since 2.5.0 Introduced.

Where the hook is called

WP_Query::get_posts()
posts_distinct_request
wp-includes/class-wp-query.php 2944
$distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );

Where the hook is used in WordPress

Usage not found.