the_comments filter-hookWP 3.1.0

Filters the comment query results.

Usage

add_filter( 'the_comments', 'wp_kama_the_comments_filter', 10, 2 );

/**
 * Function for `the_comments` filter-hook.
 * 
 * @param WP_Comment[]     $_comments An array of comments.
 * @param WP_Comment_Query $query     Current instance of WP_Comment_Query (passed by reference).
 *
 * @return WP_Comment[]
 */
function wp_kama_the_comments_filter( $_comments, $query ){

	// filter...
	return $_comments;
}
$_comments(WP_Comment[])
An array of comments.
$query(WP_Comment_Query)
Current instance of WP_Comment_Query (passed by reference).

Changelog

Since 3.1.0 Introduced.

Where the hook is called

WP_Comment_Query::get_comments()
the_comments
wp-includes/class-wp-comment-query.php 519
$_comments = apply_filters_ref_array( 'the_comments', array( $_comments, &$this ) );

Where the hook is used in WordPress

Usage not found.