Make WordPress Core

Ticket #29870: 29870.3.diff

File 29870.3.diff, 1.0 KB (added by bradyvercher, 10 years ago)
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    175175
    176176                if ( $this->hierarchical_display ) {
    177177                        $total_items = $wp_query->post_count;
    178                 } elseif ( isset( $_REQUEST['s'] ) ) {
     178                } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) {
    179179                        $total_items = $wp_query->found_posts;
    180180                } else {
    181181                        $post_counts = (array) wp_count_posts( $post_type, 'readable' );
     
    196196                        }
    197197                }
    198198
    199                 $total_pages = ceil( $total_items / $per_page );
    200 
    201199                if ( ! empty( $_REQUEST['mode'] ) ) {
    202200                        $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
    203201                        set_user_setting ( 'posts_list_mode', $mode );
     
    209207
    210208                $this->set_pagination_args( array(
    211209                        'total_items' => $total_items,
    212                         'total_pages' => $total_pages,
    213210                        'per_page' => $per_page
    214211                ) );
    215212        }