Remove $post_type global usage from media list table. Correct $post_type to 'attachment' for upload screens. see #18722.

git-svn-id: https://develop.svn.wordpress.org/trunk@19385 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-11-21 20:48:57 +00:00
parent 4feb285a78
commit 361125eaf8
2 changed files with 5 additions and 3 deletions

View File

@ -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 );
?>
<div class="alignleft actions">
<?php
if ( 'top' == $which && !is_singular() && !$this->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' ) );

View File

@ -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 ) {