WordPress at a glance
filter is not described

widget_comments_args filter-hook . WP 3.4.0

Filters the arguments for the Recent Comments widget.

Usage

add_filter( 'widget_comments_args', 'filter_function_name_6034', 10, 2 );
function filter_function_name_6034( $comment_args, $instance ){
	// filter...

	return $comment_args;
}
$comment_args(array)
An array of arguments used to retrieve the recent comments.
$instance(array)
Array of settings for the current widget.

Notes

  • Since 4.9.0 Added the $instance parameter.

Where the hook is called

WP_Widget_Recent_Comments::widget()
gutenberg_render_block_core_latest_comments()
wp-includes/widgets/class-wp-widget-recent-comments.php 95-99
$comments = get_comments( apply_filters( 'widget_comments_args', array(
	'number'      => $number,
	'status'      => 'approve',
	'post_status' => 'publish'
), $instance ) );
wp-includes/blocks/latest-comments.php 48-55
apply_filters(
	'widget_comments_args',
	array(
		'number'      => $attributes['commentsToShow'],
		'status'      => 'approve',
		'post_status' => 'publish',
	)
)

Where the hook is used (in WP core)

Does not used.