Make WordPress Core


Ignore:
Timestamp:
11/08/2010 03:43:44 PM (16 years ago)
Author:
scribu
Message:

Use get_current_screen() in list table classes. Fixes #15338

File:
1 edited

Legend:

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

    r16226 r16235  
    7979        function WP_List_Table( $args = array() ) {
    8080                $args = wp_parse_args( $args, array(
    81                         'screen' => get_current_screen(),
    8281                        'plural' => '',
    8382                        'singular' => '',
    … …  
    8584                ) );
    8685
    87                 $this->screen = $args['screen'];
    88 
    89                 if ( is_string( $this->screen ) )
    90                         $this->screen = convert_to_screen( $this->screen );
    91 
    92                 add_filter( 'manage_' . $this->screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
     86                $screen = get_current_screen();
     87
     88                add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 );
    9389
    9490                if ( !$args['plural'] )
    95                         $args['plural'] = $this->screen->base;
     91                        $args['plural'] = $screen->base;
    9692
    9793                $this->_args = $args;
    … …  
    204200         */
    205201        function views() {
     202                $screen = get_current_screen();
     203
    206204                $views = $this->get_views();
    207                 $views = apply_filters( 'views_' . $this->screen->id, $views );
     205                $views = apply_filters( 'views_' . $screen->id, $views );
    208206
    209207                if ( empty( $views ) )
    … …  
    238236         */
    239237        function bulk_actions() {
     238                $screen = get_current_screen();
    240239
    241240                if ( is_null( $this->_actions ) ) {
    242241                        $this->_actions = $this->get_bulk_actions();
    243                         $this->_actions = apply_filters( 'bulk_actions-' . $this->screen->id, $this->_actions );
     242                        $this->_actions = apply_filters( 'bulk_actions-' . $screen->id, $this->_actions );
    244243                        $two = '';
    245244                }
    … …  
    539538        function get_column_info() {
    540539                if ( !isset( $this->_column_headers ) ) {
    541                         $columns = get_column_headers( $this->screen );
    542                         $hidden = get_hidden_columns( $this->screen );
    543                         $sortable = apply_filters( 'manage_' . $this->screen->id . '_sortable_columns', $this->get_sortable_columns() );
     540                        $screen = get_current_screen();
     541
     542                        $columns = get_column_headers( $screen );
     543                        $hidden = get_hidden_columns( $screen );
     544                        $sortable = apply_filters( "manage_{$screen->id}_sortable_columns", $this->get_sortable_columns() );
    544545
    545546                        $this->_column_headers = array( $columns, $hidden, $sortable );
    … …  
    558559         */
    559560        function print_column_headers( $with_id = true ) {
    560                 $screen = $this->screen;
     561                $screen = get_current_screen();
    561562
    562563                list( $columns, $hidden, $sortable ) = $this->get_column_info();
    … …  
    811812                $args = array(
    812813                        'class' => get_class( $this ),
    813                         'screen' => $this->screen
     814                        'screen' => get_current_screen()
    814815                );
    815816
Note: See TracChangeset for help on using the changeset viewer.