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 5934585b50..8fc319ebed 100644
--- a/src/wp-admin/includes/class-wp-media-list-table.php
+++ b/src/wp-admin/includes/class-wp-media-list-table.php
@@ -174,17 +174,15 @@ class WP_Media_List_Table extends WP_List_Table {
?>
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', $this->screen->post_type, $which );
-
- submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+ 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', $this->screen->post_type, $which );
+
+ submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
+
if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
}
diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php
index de0d70c6ca..065e5d0382 100644
--- a/src/wp-admin/includes/class-wp-posts-list-table.php
+++ b/src/wp-admin/includes/class-wp-posts-list-table.php
@@ -534,7 +534,7 @@ class WP_Posts_List_Table extends WP_List_Table {
?>
months_dropdown( $this->screen->post_type );