Comments: Prime post caches in WP_Comments_List_Table.

In the `WP_Comments_List_Table` class, when the function `get_comments` is called, pass the parameter `update_comment_post_cache` set to true. This primes all the related posts for the displayed comments. This improves performance, as all posts are primed at once. 

Props spacedmonkey, adarshposimyth.
Fixes #57802.
Built from https://develop.svn.wordpress.org/trunk@55513


git-svn-id: http://core.svn.wordpress.org/trunk@55045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
spacedmonkey 2023-03-10 15:26:22 +00:00
parent c80f206e94
commit 39e6d6d348
2 changed files with 12 additions and 11 deletions

View File

@ -140,16 +140,17 @@ class WP_Comments_List_Table extends WP_List_Table {
);
$args = array(
'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
'search' => $search,
'user_id' => $user_id,
'offset' => $start,
'number' => $number,
'post_id' => $post_id,
'type' => $comment_type,
'orderby' => $orderby,
'order' => $order,
'post_type' => $post_type,
'status' => isset( $status_map[ $comment_status ] ) ? $status_map[ $comment_status ] : $comment_status,
'search' => $search,
'user_id' => $user_id,
'offset' => $start,
'number' => $number,
'post_id' => $post_id,
'type' => $comment_type,
'orderby' => $orderby,
'order' => $order,
'post_type' => $post_type,
'update_comment_post_cache' => true,
);
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-55512';
$wp_version = '6.3-alpha-55513';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.