diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index c4f288d8d0..b9eb0c2052 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -177,9 +177,10 @@ class WP_Comments_List_Table extends WP_List_Table { array_merge( $args, array( - 'count' => true, - 'offset' => 0, - 'number' => 0, + 'count' => true, + 'offset' => 0, + 'number' => 0, + 'orderby' => 'none', ) ) ); @@ -298,6 +299,7 @@ class WP_Comments_List_Table extends WP_List_Table { 'post_id' => $post_id ? $post_id : 0, 'user_id' => $current_user_id, 'count' => true, + 'orderby' => 'none', ) ); $link = add_query_arg( 'user_id', $current_user_id, $link ); @@ -518,8 +520,9 @@ class WP_Comments_List_Table extends WP_List_Table { foreach ( $comment_types as $type => $label ) { if ( get_comments( array( - 'number' => 1, - 'type' => $type, + 'count' => true, + 'orderby' => 'none', + 'type' => $type, ) ) ) { printf( diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index c63474b29a..5228076079 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -901,8 +901,8 @@ function post_comment_meta_box( $post ) { $total = get_comments( array( 'post_id' => $post->ID, - 'number' => 1, 'count' => true, + 'orderby' => 'none', ) ); $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' ); diff --git a/wp-includes/comment.php b/wp-includes/comment.php index ce0ebe769d..de23a72130 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -396,6 +396,7 @@ function get_comment_count( $post_id = 0 ) { $args = array( 'count' => true, 'update_comment_meta_cache' => false, + 'orderby' => 'none', ); if ( $post_id > 0 ) { $args['post_id'] = $post_id; @@ -1114,6 +1115,7 @@ function get_page_of_comment( $comment_id, $args = array() ) { 'fields' => 'ids', 'count' => true, 'status' => 'approve', + 'orderby' => 'none', 'parent' => 0, 'date_query' => array( array( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 16018bb58a..1169b6b130 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -295,8 +295,9 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { // Out-of-bounds, run the query again without LIMIT for total count. unset( $prepared_args['number'], $prepared_args['offset'] ); - $query = new WP_Comment_Query(); - $prepared_args['count'] = true; + $query = new WP_Comment_Query(); + $prepared_args['count'] = true; + $prepared_args['orderby'] = 'none'; $total_comments = $query->query( $prepared_args ); $max_pages = ceil( $total_comments / $request['per_page'] ); @@ -1188,8 +1189,8 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { // Only grab one comment to verify the comment has children. $comment_children = $comment->get_children( array( - 'number' => 1, - 'count' => true, + 'count' => true, + 'orderby' => 'none', ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d049007ddd..cc38f4f2b6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-beta1-56746'; +$wp_version = '6.4-beta1-56747'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.