posts_distinct
Filters the DISTINCT clause of the query.
Description
Parameters (1)
- 0. $array (array) =>
array( $distinct, &$this )
- The array.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'posts_distinct', $array );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the posts_distinct callback
- function filter_posts_distinct( $array ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( 'posts_distinct', 'filter_posts_distinct', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'posts_distinct', 'filter_posts_distinct', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/class-wp-query.php
- $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );