WordPress at a glance
filter is not described

widget_posts_args filter-hook . WP 3.4.0

Filters the arguments for the Recent Posts widget.


add_filter( 'widget_posts_args', 'filter_function_name_270', 10, 2 );
function filter_function_name_270( $args, $instance ){
	// filter...

	return $args;
An array of arguments used to retrieve the recent posts.
Array of settings for the current widget.


  • Since 4.9.0 Added the $instance parameter.

Where the hook is called

wp-includes/widgets/class-wp-widget-recent-posts.php 70-75
$r = new WP_Query( apply_filters( 'widget_posts_args', array(
	'posts_per_page'      => $number,
	'no_found_rows'       => true,
	'post_status'         => 'publish',
	'ignore_sticky_posts' => true,
), $instance ) );

Where the hook is used (in WP core)

Does not used.