apply_filters( ‘comments_array’, array $comments, int $post_id )

Filters the comments array.

Parameters

$commentsarray
Array of comments supplied to the comments template.
$post_idint
Post ID.

More Information

Used inside comments_template that allows you to catch all the comments going through the query for the post.

Source

$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );

Changelog

VersionDescription
2.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.