From acbd7696ee957438e35ebc303837a29109362788 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 3 Sep 2014 06:46:34 +0000 Subject: [PATCH] Media Library: Fix media trash handling. props ocean90, obenland. fixes #29469. git-svn-id: https://develop.svn.wordpress.org/trunk@29690 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/forms.css | 3 ++- src/wp-admin/includes/class-wp-media-list-table.php | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index 23a94d6677..b80f98aaa2 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -374,7 +374,8 @@ input[type="number"].small-text { .tablenav #changeit, .tablenav #delete_all, -.tablenav #clear-recent-list { +.tablenav #clear-recent-list, +.wp-filter #delete_all { margin-top: 1px; } 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 bb1da2ac75..237c99d155 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -37,7 +37,7 @@ class WP_Media_List_Table extends WP_List_Table { list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST ); - $this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status']; + $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' == $_REQUEST['attachment-filter']; $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; @@ -63,8 +63,6 @@ class WP_Media_List_Table extends WP_List_Table { $selected = empty( $_GET['attachment-filter'] ) ? ' selected="selected"' : ''; $type_links['all'] = "'; foreach ( $post_mime_types as $mime_type => $label ) { - $class = ''; - if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) ) continue; @@ -98,8 +96,10 @@ class WP_Media_List_Table extends WP_List_Table { ?>
is_trash ) { - $this->months_dropdown( 'attachment' ); + if ( ! is_singular() ) { + if ( ! $this->is_trash ) { + $this->months_dropdown( 'attachment' ); + } /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ do_action( 'restrict_manage_posts' );