Make WordPress Core

Changeset 19192


Ignore:
Timestamp:
11/06/2011 09:14:27 PM (15 years ago)
Author:
nacin
Message:

Don't use $post_type global in the posts list table. props scribu, see #18475.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r19054 r19192  
    4747
    4848        function __construct() {
    49                 global $post_type_object, $post_type, $wpdb;
     49                global $post_type_object, $wpdb;
    5050
    5151                if ( !isset( $_REQUEST['post_type'] ) )
    … …  
    8787
    8888        function prepare_items() {
    89                 global $post_type_object, $post_type, $avail_post_stati, $wp_query, $per_page, $mode;
     89                global $post_type_object, $avail_post_stati, $wp_query, $per_page, $mode;
    9090
    9191                $avail_post_stati = wp_edit_posts_query();
    … …  
    9595                $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
    9696
     97                $post_type = $post_type_object->name;
    9798                $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
    9899                $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
    … …  
    128129
    129130        function get_views() {
    130                 global $post_type, $post_type_object, $locked_post_status, $avail_post_stati;
     131                global $post_type_object, $locked_post_status, $avail_post_stati;
     132
     133                $post_type = $post_type_object->name;
    131134
    132135                if ( !empty($locked_post_status) )
    … …  
    203206
    204207        function extra_tablenav( $which ) {
    205                 global $post_type, $post_type_object, $cat;
     208                global $post_type_object, $cat;
    206209?>
    207210                <div class="alignleft actions">
    … …  
    209212                if ( 'top' == $which && !is_singular() ) {
    210213
    211                         $this->months_dropdown( $post_type );
    212 
    213                         if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
     214                        $this->months_dropdown( $post_type_object->name );
     215
     216                        if ( is_object_in_taxonomy( $post_type_object->name, 'category' ) ) {
    214217                                $dropdown_options = array(
    215218                                        'show_option_all' => __( 'View all categories' ),
Note: See TracChangeset for help on using the changeset viewer.