Changeset 61002
- Timestamp:
- 10/21/2025 03:31:55 AM (8 weeks ago)
- Location:
- trunk/src/wp-includes/rest-api/endpoints
- Files:
-
- 5 edited
-
class-wp-rest-comments-controller.php (modified) (1 diff)
-
class-wp-rest-global-styles-revisions-controller.php (modified) (1 diff)
-
class-wp-rest-posts-controller.php (modified) (1 diff)
-
class-wp-rest-revisions-controller.php (modified) (1 diff)
-
class-wp-rest-users-controller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r60987 r61002 324 324 325 325 if ( $total_comments < 1 ) { 326 // Out-of-bounds, run the query again without LIMIT fortotal count.326 // Out-of-bounds, run the query without pagination/offset to get the total count. 327 327 unset( $prepared_args['number'], $prepared_args['offset'] ); 328 328 329 $query = new WP_Comment_Query(); 330 $prepared_args['count'] = true; 331 $prepared_args['orderby'] = 'none'; 329 $query = new WP_Comment_Query(); 330 $prepared_args['count'] = true; 331 $prepared_args['orderby'] = 'none'; 332 $prepared_args['update_comment_meta_cache'] = false; 332 333 333 334 $total_comments = $query->query( $prepared_args ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php
r59970 r61002 204 204 205 205 if ( $total_revisions < 1 ) { 206 // Out-of-bounds, run the query again without LIMIT fortotal count.206 // Out-of-bounds, run the query without pagination/offset to get the total count. 207 207 unset( $query_args['paged'], $query_args['offset'] ); 208 $count_query = new WP_Query(); 208 209 $count_query = new WP_Query(); 210 $query_args['fields'] = 'ids'; 211 $query_args['posts_per_page'] = 1; 212 $query_args['update_post_meta_cache'] = false; 213 $query_args['update_post_term_cache'] = false; 214 209 215 $count_query->query( $query_args ); 210 216 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r60814 r61002 488 488 489 489 if ( $total_posts < 1 && $page > 1 ) { 490 // Out-of-bounds, run the query again without LIMIT fortotal count.490 // Out-of-bounds, run the query without pagination/offset to get the total count. 491 491 unset( $query_args['paged'] ); 492 492 493 $count_query = new WP_Query(); 493 $count_query = new WP_Query(); 494 $query_args['fields'] = 'ids'; 495 $query_args['posts_per_page'] = 1; 496 $query_args['update_post_meta_cache'] = false; 497 $query_args['update_post_term_cache'] = false; 498 494 499 $count_query->query( $query_args ); 495 500 $total_posts = $count_query->found_posts; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r59970 r61002 309 309 310 310 if ( $total_revisions < 1 ) { 311 // Out-of-bounds, run the query again without LIMIT fortotal count.311 // Out-of-bounds, run the query without pagination/offset to get the total count. 312 312 unset( $query_args['paged'], $query_args['offset'] ); 313 313 314 $count_query = new WP_Query(); 314 $count_query = new WP_Query(); 315 $query_args['fields'] = 'ids'; 316 $query_args['posts_per_page'] = 1; 317 $query_args['update_post_meta_cache'] = false; 318 $query_args['update_post_term_cache'] = false; 319 315 320 $count_query->query( $query_args ); 316 317 321 $total_revisions = $count_query->found_posts; 318 322 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r60814 r61002 400 400 401 401 if ( $total_users < 1 ) { 402 // Out-of-bounds, run the query again without LIMIT fortotal count.402 // Out-of-bounds, run the query without pagination/offset to get the total count. 403 403 unset( $prepared_args['number'], $prepared_args['offset'] ); 404 $count_query = new WP_User_Query( $prepared_args ); 405 $total_users = $count_query->get_total(); 404 405 $prepared_args['number'] = 1; 406 $prepared_args['fields'] = 'ID'; 407 $count_query = new WP_User_Query( $prepared_args ); 408 $total_users = $count_query->get_total(); 406 409 } 407 410
Note: See TracChangeset
for help on using the changeset viewer.