From a521a4e7f6d7f8dcfd71b658cc4262cd4a2eebc1 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 10 Oct 2015 06:32:51 +0000 Subject: [PATCH] Dashboard: Introduce the `dashboard_recent_drafts_query_args` filter, making it possible to manipulate the post query arguments used in the 'Recent Drafts' dashboard widget. Props iamfriendly. Fixes #8243. git-svn-id: https://develop.svn.wordpress.org/trunk@35003 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/dashboard.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 8585234d8b..2006993c39 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -522,6 +522,16 @@ function wp_dashboard_recent_drafts( $drafts = false ) { 'orderby' => 'modified', 'order' => 'DESC' ); + + /** + * Filter the post query arguments for the 'Recent Drafts' dashboard widget. + * + * @since 4.4.0 + * + * @param array $query_args The query arguments for the recent drafts dashboard widget. + */ + $query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args ); + $drafts = get_posts( $query_args ); if ( ! $drafts ) { return;