found_comments_query filter-hookWP 4.4.0

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

WP_Comment_Query::set_found_comments()
found_comments_query
wp-includes/class-wp-comment-query.php 1001
$found_comments_query = apply_filters( 'found_comments_query', 'SELECT FOUND_ROWS()', $this );

Where the hook is used in WordPress

Usage not found.