comments_array WordPress Filter Hook
The comments_array hook is used to modify the comments array before it is used to generate comment HTML. This can be useful for adding extra data to each comment, or for modifying existing comment data.
apply_filters( 'comments_array', array $comments , int $post_ID ) #
Filters the comments array.
Parameters
- $comments
(array)Array of comments supplied to the comments template.
- $post_ID
(int)Post ID.
More Information
Used inside comments_template that allows you to catch all the comments going through the query for the post.
Source
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |