Changeset 57648
- Timestamp:
- 02/17/2024 03:22:37 PM (8 months ago)
- Location:
- trunk/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r57545 r57648 562 562 /* translators: %s: Number of comments. */ 563 563 'total_items_i18n' => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ), 564 'total_pages' => ceil( $total / $per_page ),565 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),564 'total_pages' => (int) ceil( $total / $per_page ), 565 'total_pages_i18n' => number_format_i18n( (int) ceil( $total / $per_page ) ), 566 566 'total' => $total, 567 567 'time' => $time, … … 3090 3090 $posts_per_page = (int) $attachments_query->get( 'posts_per_page' ); 3091 3091 3092 $max_pages = $posts_per_page ? ceil( $total_posts / $posts_per_page ) : 0;3092 $max_pages = $posts_per_page ? (int) ceil( $total_posts / $posts_per_page ) : 0; 3093 3093 3094 3094 header( 'X-WP-Total: ' . (int) $total_posts ); 3095 header( 'X-WP-TotalPages: ' . (int)$max_pages );3095 header( 'X-WP-TotalPages: ' . $max_pages ); 3096 3096 3097 3097 wp_send_json_success( $posts ); -
trunk/src/wp-admin/includes/class-wp-list-table.php
r57644 r57648 320 320 321 321 if ( ! $args['total_pages'] && $args['per_page'] > 0 ) { 322 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );322 $args['total_pages'] = (int) ceil( $args['total_items'] / $args['per_page'] ); 323 323 } 324 324 -
trunk/src/wp-admin/includes/media.php
r57524 r57648 2833 2833 'prev_text' => __( '«' ), 2834 2834 'next_text' => __( '»' ), 2835 'total' => ceil( $wp_query->found_posts / 10 ),2835 'total' => (int) ceil( $wp_query->found_posts / 10 ), 2836 2836 'current' => $q['paged'], 2837 2837 ) -
trunk/src/wp-admin/includes/nav-menu.php
r56599 r57648 875 875 } 876 876 877 $num_pages = ceil(877 $num_pages = (int) ceil( 878 878 wp_count_terms( 879 879 array_merge( -
trunk/src/wp-includes/class-wp-comment-query.php
r57342 r57648 471 471 472 472 if ( $this->found_comments && $this->query_vars['number'] ) { 473 $this->max_num_pages = ceil( $this->found_comments / $this->query_vars['number'] );473 $this->max_num_pages = (int) ceil( $this->found_comments / $this->query_vars['number'] ); 474 474 } 475 475 -
trunk/src/wp-includes/class-wp-network-query.php
r55526 r57648 270 270 271 271 if ( $this->found_networks && $this->query_vars['number'] ) { 272 $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] );272 $this->max_num_pages = (int) ceil( $this->found_networks / $this->query_vars['number'] ); 273 273 } 274 274 -
trunk/src/wp-includes/class-wp-query.php
r57312 r57648 3625 3625 3626 3626 if ( ! empty( $limits ) ) { 3627 $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );3627 $this->max_num_pages = (int) ceil( $this->found_posts / $q['posts_per_page'] ); 3628 3628 } 3629 3629 } -
trunk/src/wp-includes/class-wp-site-query.php
r57644 r57648 378 378 379 379 if ( $this->found_sites && $this->query_vars['number'] ) { 380 $this->max_num_pages = ceil( $this->found_sites / $this->query_vars['number'] );380 $this->max_num_pages = (int) ceil( $this->found_sites / $this->query_vars['number'] ); 381 381 } 382 382 -
trunk/src/wp-includes/class-wp-walker.php
r56549 r57648 311 311 $end = $start + $per_page; 312 312 if ( -1 == $max_depth ) { 313 $this->max_pages = ceil( $total_top / $per_page );313 $this->max_pages = (int) ceil( $total_top / $per_page ); 314 314 } 315 315 } … … 355 355 $total_top = count( $top_level_elements ); 356 356 if ( $paging ) { 357 $this->max_pages = ceil( $total_top / $per_page );357 $this->max_pages = (int) ceil( $total_top / $per_page ); 358 358 } else { 359 359 $end = $total_top; -
trunk/src/wp-includes/comment-template.php
r56687 r57648 1516 1516 $top_level_count = $top_level_query->query( $top_level_args ); 1517 1517 1518 $comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;1518 $comment_args['offset'] = ( (int) ceil( $top_level_count / $per_page ) - 1 ) * $per_page; 1519 1519 } 1520 1520 } -
trunk/src/wp-includes/comment.php
r57644 r57648 1032 1032 } 1033 1033 1034 return $count;1034 return (int) $count; 1035 1035 } 1036 1036 … … 1171 1171 // Divide comments older than this one by comments per page to get this comment's page number. 1172 1172 } else { 1173 $page = ceil( ( $older_comment_count + 1 ) / $args['per_page'] );1173 $page = (int) ceil( ( $older_comment_count + 1 ) / $args['per_page'] ); 1174 1174 } 1175 1175 } -
trunk/src/wp-includes/embed.php
r56682 r57648 74 74 } 75 75 76 $height = min( ceil( $width * 1.5 ), 1000 );76 $height = min( (int) ceil( $width * 1.5 ), 1000 ); 77 77 78 78 /** … … 578 578 579 579 $width = min( max( $min_max_width['min'], $width ), $min_max_width['max'] ); 580 $height = max( ceil( $width / 16 * 9 ), 200 );580 $height = max( (int) ceil( $width / 16 * 9 ), 200 ); 581 581 582 582 $data = array( -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r57176 r57648 301 301 302 302 $total_comments = $query->query( $prepared_args ); 303 $max_pages = ceil( $total_comments / $request['per_page'] );303 $max_pages = (int) ceil( $total_comments / $request['per_page'] ); 304 304 } 305 305 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php
r57548 r57648 78 78 $per_page = $request['per_page']; 79 79 $total_items = count( $collections_all ); 80 $max_pages = ceil( $total_items / $per_page );80 $max_pages = (int) ceil( $total_items / $per_page ); 81 81 82 82 if ( $page > $max_pages && $total_items > 0 ) { -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php
r57628 r57648 207 207 208 208 if ( $revisions_query->query_vars['posts_per_page'] > 0 ) { 209 $max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );209 $max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] ); 210 210 } else { 211 211 $max_pages = $total_revisions > 0 ? 1 : 0; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r57603 r57648 404 404 } 405 405 406 $max_pages = ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] );406 $max_pages = (int) ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] ); 407 407 408 408 if ( $page > $max_pages && $total_posts > 0 ) { -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r57230 r57648 309 309 310 310 if ( $revisions_query->query_vars['posts_per_page'] > 0 ) { 311 $max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );311 $max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] ); 312 312 } else { 313 313 $max_pages = $total_revisions > 0 ? 1 : 0; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php
r56586 r57648 153 153 $page = (int) $request['page']; 154 154 $per_page = (int) $request['per_page']; 155 $max_pages = ceil( $total / $per_page );155 $max_pages = (int) ceil( $total / $per_page ); 156 156 157 157 if ( $page > $max_pages && $total > 0 ) { -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r56415 r57648 349 349 // Store pagination values for headers. 350 350 $per_page = (int) $prepared_args['number']; 351 $page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );351 $page = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); 352 352 353 353 $response->header( 'X-WP-Total', (int) $total_terms ); 354 354 355 $max_pages = ceil( $total_terms / $per_page );356 357 $response->header( 'X-WP-TotalPages', (int)$max_pages );355 $max_pages = (int) ceil( $total_terms / $per_page ); 356 357 $response->header( 'X-WP-TotalPages', $max_pages ); 358 358 359 359 $request_params = $request->get_query_params(); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r56833 r57648 349 349 // Store pagination values for headers then unset for count query. 350 350 $per_page = (int) $prepared_args['number']; 351 $page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );351 $page = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); 352 352 353 353 $prepared_args['fields'] = 'ID'; … … 364 364 $response->header( 'X-WP-Total', (int) $total_users ); 365 365 366 $max_pages = ceil( $total_users / $per_page );367 368 $response->header( 'X-WP-TotalPages', (int)$max_pages );366 $max_pages = (int) ceil( $total_users / $per_page ); 367 368 $response->header( 'X-WP-TotalPages', $max_pages ); 369 369 370 370 $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
Note: See TracChangeset
for help on using the changeset viewer.