From 5f60ab4076fb50cb546beaa0865f8dd8721ad477 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 21 Nov 2011 20:48:57 +0000 Subject: [PATCH] Remove $post_type global usage from media list table. Correct $post_type to 'attachment' for upload screens. see #18722. git-svn-id: http://svn.automattic.com/wordpress/trunk@19385 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-media-list-table.php | 4 +--- wp-admin/includes/screen.php | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index 44f2b7907c..0e29d7f688 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -84,13 +84,11 @@ class WP_Media_List_Table extends WP_List_Table { } function extra_tablenav( $which ) { - global $post_type; - $post_type_obj = get_post_type_object( $post_type ); ?>
detached && !$this->is_trash ) { - $this->months_dropdown( $post_type ); + $this->months_dropdown( 'attachment' ); do_action( 'restrict_manage_posts' ); submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index 9ee21d020a..0416d11f23 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -490,6 +490,10 @@ final class WP_Screen { $taxonomy = 'post_tag'; $id = 'edit-' . $taxonomy; break; + case 'upload' : + if ( null === $post_type ) + $post_type = 'attachment'; + break; } if ( $is_network ) {