From 2dd6c6e696044ab313ea9cb60d88fbff51a24089 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 22 Feb 2015 19:56:09 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/dashboard.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 0cedf72dbd..62f3f70ca2 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -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() ) {