Ticket #46346: wp-list-table-integer-total-pages.patch
File wp-list-table-integer-total-pages.patch, 705 bytes (added by , 6 years ago) |
---|
-
wp-admin/includes/class-wp-list-table.php
a b 283 283 ) 284 284 ); 285 285 286 if ( !$args['total_pages'] && $args['per_page'] > 0 ) 287 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); 286 if ( !$args['total_pages'] && $args['per_page'] > 0 ) { 287 $over = $args['total_items'] % $args['per_page']; 288 $args['total_pages'] = ( (bool) $over ) + ( ( $args['total_items'] - $over ) / $args['per_page'] ); 289 } 288 290 289 291 // Redirect if page number is invalid and headers are not already sent. 290 292 if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {