Make WordPress Core


Ignore:
Timestamp:
08/22/2010 11:22:46 AM (15 years ago)
Author:
scribu
Message:

replace $table with $wp_list_table. See #14651

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/deprecated.php

    r15517 r15519  
    212212    _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' );
    213213
    214     global $_wp_column_headers;
    215 
    216     if ( is_string($screen) )
    217         $screen = convert_to_screen($screen);
    218 
    219     if ( !isset($_wp_column_headers) )
    220         $_wp_column_headers = array();
    221 
    222     $_wp_column_headers[$screen->id] = $columns;
     214    global $wp_list_table;
     215
     216    $wp_list_table = new _WP_List_Table_Compat($screen);
     217    $wp_list_table->_columns = $columns;
    223218}
    224219
     
    236231    _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' );
    237232
    238     $table = new _WP_List_Table_Compat($screen);
    239     list( $columns ) = $table->get_column_headers();
     233    global $wp_list_table;
     234    if ( !is_a($wp_list_table, 'WP_List_Table') )
     235        $wp_list_table = new _WP_List_Table_Compat($screen);
     236
     237    list( $columns ) = $wp_list_table->get_column_headers();
    240238
    241239    return $columns;
     
    252250    _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' );
    253251
    254     $table = new _WP_List_Table_Compat($screen);
    255 
    256     $table->print_column_headers($id);
     252    global $wp_list_table;
     253    if ( !is_a($wp_list_table, 'WP_List_Table') )
     254        $wp_list_table = new _WP_List_Table_Compat($screen);
     255
     256    $wp_list_table->print_column_headers($id);
    257257}
    258258
     
    270270    _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' );
    271271
    272     $table = new _WP_List_Table_Compat($screen);
    273 
    274     return $table->get_hidden_columns();
     272    global $wp_list_table;
     273    if ( !is_a($wp_list_table, 'WP_List_Table') )
     274        $wp_list_table = new _WP_List_Table_Compat($screen);
     275
     276    return $wp_list_table->get_hidden_columns();
    275277}
    276278
    277279// Helper class to be used only by deprecated functions
    278280class _WP_List_Table_Compat extends WP_List_Table {
     281
     282    var $_columns = array();
    279283
    280284    function _WP_List_Table_Compat( $screen) {
     
    286290
    287291    function get_columns() {
    288         global $_wp_column_headers;
    289 
    290         if ( isset($_wp_column_headers[$this->_screen->id]) )
    291             return $_wp_column_headers[$this->_screen->id];
    292 
    293         return array();
     292        return $this->_columns;
    294293    }
    295294}
Note: See TracChangeset for help on using the changeset viewer.