comments_array filter-hookWP 2.1.0

Filters the comments array.

Usage

add_filter( 'comments_array', 'wp_kama_comments_array_filter', 10, 2 );

/**
 * Function for `comments_array` filter-hook.
 * 
 * @param array $comments Array of comments supplied to the comments template.
 * @param int   $post_ID  Post ID.
 *
 * @return array
 */
function wp_kama_comments_array_filter( $comments, $post_ID ){

	// filter...
	return $comments;
}
$comments(array)
Array of comments supplied to the comments template.
$post_ID(int)
Post ID.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

comments_template()
comments_array
wp-includes/comment-template.php 1520
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );

Where the hook is used in WordPress

Usage not found.