widget_posts_args WordPress Filter Hook
The widget_posts_args hook is used to modify the arguments used in WP_Query when fetching posts to display in a widget. This hook can be used to change the number of posts displayed, the order in which they are displayed, or any other arguments supported by WP_Query.
apply_filters( 'widget_posts_args', array $args , array $instance ) #
Filters the arguments for the Recent Posts widget.
Description
See also
Parameters
- $args
(array)An array of arguments used to retrieve the recent posts.
- $instance
(array)Array of settings for the current widget.
More Information
Use any of the WP_Query parameters for $args.
Source
Changelog
Version | Description |
---|---|
4.9.0 | Added the $instance parameter. |
3.4.0 | Introduced. |