wphooks.info - widget_posts_args

widget_posts_args

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/widgets/class-wp-widget-recent-posts.php:
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
		 * Filters the arguments for the Recent Posts widget.
		 *
		 * @since 3.4.0
		 * @since 4.9.0 Added the `$instance` parameter.
		 *
		 * @see WP_Query::get_posts()
		 *
		 * @param array $args     An array of arguments used to retrieve the recent posts.
		 * @param array $instance Array of settings for the current widget.
		 */
		$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 ) );

		if ( ! $r->have_posts() ) {
			return;
		}