widget_comments_args WordPress Filter Hook
The widget_comments_args hook allows you to modify the default arguments used when retrieving comments for a widget. This can be useful if you want to change the number of comments displayed or the order in which they are displayed.
apply_filters( 'widget_comments_args', array $comment_args , array $instance ) #
Filters the arguments for the Recent Comments widget.
Description
See also
- WP_Comment_Query::query(): for information on accepted arguments.
Parameters
- $comment_args
(array)An array of arguments used to retrieve the recent comments.
- $instance
(array)Array of settings for the current widget.
Source
File: wp-includes/widgets/class-wp-widget-recent-comments.php
Changelog
Version | Description |
---|---|
4.9.0 | Added the $instance parameter. |
3.4.0 | Introduced. |