posts_groupby
Filters the GROUP BY clause of the query.
Usage
add_filter( 'posts_groupby', 'wp_kama_posts_groupby_filter', 10, 2 ); function wp_kama_posts_groupby_filter( $groupby, $query ){ // filter... return $groupby; }
- $groupby(string)
- The GROUP BY clause of the query.
- $query(WP_Query)
- The WP_Query instance (passed by reference).
Changelog
Since 2.0.0 | Introduced. |
Where the hook is called
posts_groupby
wp-includes/class-wp-query.php 2771
$groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );