Dashboard: Add a filter for the query arguments used for the Recent Posts widget.

props danielbachhuber.
fixes #29374.

git-svn-id: https://develop.svn.wordpress.org/trunk@31508 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-02-22 19:56:09 +00:00
parent 5e1241d587
commit 2dd6c6e696
1 changed files with 9 additions and 0 deletions

View File

@ -689,6 +689,15 @@ function wp_dashboard_recent_posts( $args ) {
'cache_results' => false,
'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable',
);
/**
* Filter the query arguments used for the Recent Posts widget.
*
* @since 4.2.0
*
* @param array $query_args The arguments passed to WP_Query to produce the list of posts.
*/
$query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );
$posts = new WP_Query( $query_args );
if ( $posts->have_posts() ) {