mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor: Fix Comment Query block isn't lazy loading meta data
Related GitHub issue: https://github.com/WordPress/gutenberg/issues/40241. Primes comment meta data cache within calls to WP_Comment_Query. Props peterwilsoncc, cbravobernal. See #55567. Follow-up [53138]. git-svn-id: https://develop.svn.wordpress.org/trunk@53214 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7e65fcbbef
commit
c755258903
@ -1397,7 +1397,6 @@ function build_comment_query_vars_from_block( $block ) {
|
||||
'order' => 'ASC',
|
||||
'status' => 'approve',
|
||||
'no_found_rows' => false,
|
||||
'update_comment_meta_cache' => false, // We lazy-load comment meta for performance.
|
||||
);
|
||||
|
||||
if ( ! empty( $block->context['postId'] ) ) {
|
||||
|
||||
@ -67,15 +67,14 @@ class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase {
|
||||
|
||||
$this->assertEquals(
|
||||
array(
|
||||
'orderby' => 'comment_date_gmt',
|
||||
'order' => 'ASC',
|
||||
'status' => 'approve',
|
||||
'no_found_rows' => false,
|
||||
'update_comment_meta_cache' => false,
|
||||
'post_id' => self::$custom_post->ID,
|
||||
'hierarchical' => 'threaded',
|
||||
'number' => 5,
|
||||
'paged' => 1,
|
||||
'orderby' => 'comment_date_gmt',
|
||||
'order' => 'ASC',
|
||||
'status' => 'approve',
|
||||
'no_found_rows' => false,
|
||||
'post_id' => self::$custom_post->ID,
|
||||
'hierarchical' => 'threaded',
|
||||
'number' => 5,
|
||||
'paged' => 1,
|
||||
),
|
||||
build_comment_query_vars_from_block( $block )
|
||||
);
|
||||
@ -94,14 +93,13 @@ class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase {
|
||||
|
||||
$this->assertEquals(
|
||||
array(
|
||||
'orderby' => 'comment_date_gmt',
|
||||
'order' => 'ASC',
|
||||
'status' => 'approve',
|
||||
'no_found_rows' => false,
|
||||
'update_comment_meta_cache' => false,
|
||||
'hierarchical' => 'threaded',
|
||||
'number' => 5,
|
||||
'paged' => 1,
|
||||
'orderby' => 'comment_date_gmt',
|
||||
'order' => 'ASC',
|
||||
'status' => 'approve',
|
||||
'no_found_rows' => false,
|
||||
'hierarchical' => 'threaded',
|
||||
'number' => 5,
|
||||
'paged' => 1,
|
||||
),
|
||||
build_comment_query_vars_from_block( $block )
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user