mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Improve count in Media Library pagination.
Deleting all visible items on the last page of the media library previously left a blank page with no media items available. Using `wp_count_attachements` instead of `found_posts` solves the problem. Props donsony, karmatosed, desrosj, mista-flo, justinahinon. Fixes #39968. git-svn-id: https://develop.svn.wordpress.org/trunk@49567 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4006c07417
commit
4afa79feed
@ -100,8 +100,7 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
|
||||
$this->set_pagination_args(
|
||||
array(
|
||||
'total_items' => $wp_query->found_posts,
|
||||
'total_pages' => $wp_query->max_num_pages,
|
||||
'total_items' => array_sum( (array) wp_count_attachments() ),
|
||||
'per_page' => $wp_query->query_vars['posts_per_page'],
|
||||
)
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user