WordPress.org

Make WordPress Core

Ticket #39968: 39968.2.patch

File 39968.2.patch, 1.0 KB (added by Mista-Flo, 4 months ago)

Second patch

  • src/wp-admin/includes/class-wp-media-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php
    index 031f306987..27b98ba35e 100644
    a b class WP_Media_List_Table extends WP_List_Table { 
    9898
    9999                $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];
    100100
     101                $total_items = array_sum( (array) wp_count_attachments() );
     102                // If there are some query filters, we need to adapt logic
     103                if ( ! empty( $wp_query->query['m'] ) || ! empty( $wp_query->query['post_mime_type'] ) || ! empty( $wp_query->query['cat'] ) || ! empty( $wp_query->query['s'] ) ) {
     104                        $total_items = $wp_query->found_posts;
     105                }
     106
    101107                $this->set_pagination_args(
    102108                        array(
    103                                 'total_items' => $wp_query->found_posts,
    104                                 'total_pages' => $wp_query->max_num_pages,
     109                                'total_items' => $total_items,
    105110                                'per_page'    => $wp_query->query_vars['posts_per_page'],
    106111                        )
    107112                );