From 7d503a499f39dba9afe9d65f67213e66144722bd Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Thu, 8 Jun 2023 10:00:07 +0000 Subject: [PATCH] Query: Allow queries by `wp_dashboard_recent_posts()` to be cached. Set the `cache_results` argument to `true` for `WP_Query` to ensure the posts queries on the dashboard can also be cached. Props benjgrolleau. Fixes #57055. git-svn-id: https://develop.svn.wordpress.org/trunk@55895 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index df1cfa1881..525e51f0cf 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -982,7 +982,7 @@ function wp_dashboard_recent_posts( $args ) { 'order' => $args['order'], 'posts_per_page' => (int) $args['max'], 'no_found_rows' => true, - 'cache_results' => false, + 'cache_results' => true, 'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable', );