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
This commit is contained in:
Andrew Nacin 2014-09-03 06:46:34 +00:00
parent 760b7ae45a
commit acbd7696ee
2 changed files with 7 additions and 6 deletions

View File

@ -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;
}

View File

@ -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'] = "<option value=''$selected>" . sprintf( _nx( 'All (%s)', 'All (%s)', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</option>';
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 {
?>
<div class="actions">
<?php
if ( ! is_singular() && ! $this->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' );