From ec93f031b3f889c8c4c11debb66c4ecac35074a9 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 2 Oct 2014 03:11:49 +0000 Subject: [PATCH] Media List Table: account for `MEDIA_TRASH` in the bulk action dropdown. See #29742. git-svn-id: https://develop.svn.wordpress.org/trunk@29810 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-media-list-table.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 237c99d155..688b7b8ae5 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -82,7 +82,17 @@ class WP_Media_List_Table extends WP_List_Table { protected function get_bulk_actions() { $actions = array(); - $actions['delete'] = __( 'Delete Permanently' ); + if ( MEDIA_TRASH ) { + if ( $this->is_trash ) { + $actions['untrash'] = __( 'Restore' ); + $actions['delete'] = __( 'Delete Permanently' ); + } else { + $actions['trash'] = __( 'Trash' ); + } + } else { + $actions['delete'] = __( 'Delete Permanently' ); + } + if ( $this->detached ) $actions['attach'] = __( 'Attach to a post' );