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_6264', 10, 2 );
function filter_function_name_6264( $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()
widget_comments_args
render_block_core_latest_comments()
widget_comments_args
wp-includes/widgets/class-wp-widget-recent-comments.php 99-107
apply_filters(
	'widget_comments_args',
	array(
		'number'      => $number,
		'status'      => 'approve',
		'post_status' => 'publish',
	),
	$instance
)
wp-includes/blocks/latest-comments.php 46-53
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.