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
This commit is contained in:
Dominik Schilling 2023-06-08 10:00:07 +00:00
parent 624a6c4990
commit 7d503a499f

View File

@ -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',
);