found_comments_query
Filters the query used to retrieve found comment count.
Usage
add_filter( 'found_comments_query', 'wp_kama_found_comments_query_filter', 10, 2 ); /** * Function for `found_comments_query` filter-hook. * * @param string $found_comments_query SQL query. * @param WP_Comment_Query $comment_query The `WP_Comment_Query` instance. * * @return string */ function wp_kama_found_comments_query_filter( $found_comments_query, $comment_query ){ // filter... return $found_comments_query; }
- $found_comments_query(string)
- SQL query.
Default: 'SELECT FOUND_ROWS()' - $comment_query(WP_Comment_Query)
- The WP_Comment_Query instance.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
found_comments_query
wp-includes/class-wp-comment-query.php 1004
$found_comments_query = apply_filters( 'found_comments_query', 'SELECT FOUND_ROWS()', $this );