On this page
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
File: wp-includes/comment-template.php. View all references
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
Related
Used By
| Used By | Description |
|---|---|
| comments_template() wp-includes/comment-template.php | Loads the comment template specified in $file. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/comments_array