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 { |
98 | 98 | |
99 | 99 | $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter']; |
100 | 100 | |
| 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 | |
101 | 107 | $this->set_pagination_args( |
102 | 108 | array( |
103 | | 'total_items' => $wp_query->found_posts, |
104 | | 'total_pages' => $wp_query->max_num_pages, |
| 109 | 'total_items' => $total_items, |
105 | 110 | 'per_page' => $wp_query->query_vars['posts_per_page'], |
106 | 111 | ) |
107 | 112 | ); |