Ticket #29870: 29870.3.diff
File 29870.3.diff, 1.0 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
175 175 176 176 if ( $this->hierarchical_display ) { 177 177 $total_items = $wp_query->post_count; 178 } elseif ( isset( $_REQUEST['s'] )) {178 } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) { 179 179 $total_items = $wp_query->found_posts; 180 180 } else { 181 181 $post_counts = (array) wp_count_posts( $post_type, 'readable' ); … … 196 196 } 197 197 } 198 198 199 $total_pages = ceil( $total_items / $per_page );200 201 199 if ( ! empty( $_REQUEST['mode'] ) ) { 202 200 $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list'; 203 201 set_user_setting ( 'posts_list_mode', $mode ); … … 209 207 210 208 $this->set_pagination_args( array( 211 209 'total_items' => $total_items, 212 'total_pages' => $total_pages,213 210 'per_page' => $per_page 214 211 ) ); 215 212 }