Make WordPress Core

Changeset 15519


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

replace $table with $wp_list_table. See #14651

Location:
trunk/wp-admin
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r15513 r15519  
    5959        global $current_screen;
    6060        $current_screen = (object) $_GET['list_args']['screen'];
    61         $table = new $class;
    62         $table->ajax_response();
     61        $wp_list_table = new $class;
     62        $wp_list_table->ajax_response();
    6363    }
    6464
     
    559559
    560560    require_once( './includes/default-list-tables.php' );
    561     $table = new WP_Terms_Table();
     561    $wp_list_table = new WP_Terms_Table();
    562562
    563563    $level = 0;
     
    571571            $level++;
    572572        }
    573         $noparents = $table->single_row( $tag, $level, $taxonomy );
     573        $noparents = $wp_list_table->single_row( $tag, $level, $taxonomy );
    574574    }
    575575    $tag->name = $tag_full_name;
    576     $parents = $table->single_row( $tag, 0, $taxonomy);
     576    $parents = $wp_list_table->single_row( $tag, 0, $taxonomy);
    577577
    578578    $x->add( array(
     
    627627
    628628    require_once( './includes/default-list-tables.php' );
    629     $table = new WP_Comments_Table();
    630     $table->prepare_items();
    631 
    632     if ( !$table->has_items() )
     629    $wp_list_table = new WP_Comments_Table();
     630    $wp_list_table->prepare_items();
     631
     632    if ( !$wp_list_table->has_items() )
    633633        die('1');
    634634
    635635    $x = new WP_Ajax_Response();
    636     foreach ( $table->items as $comment ) {
     636    foreach ( $wp_list_table->items as $comment ) {
    637637        get_comment( $comment );
    638638        ob_start();
    639             $table->single_row( $comment->comment_ID, $mode, $comment_status, true, true );
     639            $wp_list_table->single_row( $comment->comment_ID, $mode, $comment_status, true, true );
    640640            $comment_list_item = ob_get_contents();
    641641        ob_end_clean();
     
    656656
    657657    require_once( './includes/default-list-tables.php' );
    658     $table = new WP_Comments_Table();
    659     $table->prepare_items();
    660 
    661     if ( !$table->has_items() )
     658    $wp_list_table = new WP_Comments_Table();
     659    $wp_list_table->prepare_items();
     660
     661    if ( !$wp_list_table->has_items() )
    662662        die('1');
    663663
    664664    $comment_list_item = '';
    665665    $x = new WP_Ajax_Response();
    666     foreach ( $table->items as $comment ) {
     666    foreach ( $wp_list_table->items as $comment ) {
    667667        get_comment( $comment );
    668668        ob_start();
    669             $table->single_row( $comment->comment_ID, 'single', false, false );
     669            $wp_list_table->single_row( $comment->comment_ID, 'single', false, false );
    670670            $comment_list_item .= ob_get_contents();
    671671        ob_end_clean();
     
    681681
    682682    require_once( './includes/default-list-tables.php' );
    683     $table = new WP_Comments_Table();
     683    $wp_list_table = new WP_Comments_Table();
    684684
    685685    $comment_post_ID = (int) $_POST['comment_post_ID'];
     
    730730            _wp_dashboard_recent_comments_row( $comment, false );
    731731        } else {
    732             $table->single_row( $comment->comment_ID, $mode, false, $checkbox );
     732            $wp_list_table->single_row( $comment->comment_ID, $mode, false, $checkbox );
    733733        }
    734734        $comment_list_item = ob_get_contents();
     
    763763
    764764    require_once( './includes/default-list-tables.php' );
    765     $table = new WP_Comments_Table();
     765    $wp_list_table = new WP_Comments_Table();
    766766
    767767    ob_start();
    768         $table->single_row( $comment_id, $mode, $comments_listing, $checkbox );
     768        $wp_list_table->single_row( $comment_id, $mode, $comments_listing, $checkbox );
    769769        $comment_list_item = ob_get_contents();
    770770    ob_end_clean();
     
    912912
    913913    require_once( './includes/default-list-tables.php' );
    914     $table = new WP_Users_Table();
     914    $wp_list_table = new WP_Users_Table();
    915915
    916916    $x = new WP_Ajax_Response( array(
    917917        'what' => 'user',
    918918        'id' => $user_id,
    919         'data' => $table->single_row( $user_object, '', $user_object->roles[0] ),
     919        'data' => $wp_list_table->single_row( $user_object, '', $user_object->roles[0] ),
    920920        'supplemental' => array(
    921921            'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
     
    12051205
    12061206    require_once( './includes/default-list-tables.php' );
    1207     $table = new WP_Posts_Table();
     1207    $wp_list_table = new WP_Posts_Table();
    12081208
    12091209    $mode = $_POST['post_view'];
    1210     $table->display_rows( array( get_post( $_POST['post_ID'] ) ) );
     1210    $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) );
    12111211
    12121212    exit;
     
    12161216
    12171217    require_once( './includes/default-list-tables.php' );
    1218     $table = new WP_Terms_Table();
    1219 
    1220     $table->check_permissions('edit');
     1218    $wp_list_table = new WP_Terms_Table();
     1219
     1220    $wp_list_table->check_permissions('edit');
    12211221
    12221222    if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
     
    12351235        }
    12361236
    1237         echo $table->single_row( $tag, 0, $taxonomy );
     1237        echo $wp_list_table->single_row( $tag, 0, $taxonomy );
    12381238    } else {
    12391239        if ( is_wp_error($updated) && $updated->get_error_message() )
  • trunk/wp-admin/edit-comments.php

    r15509 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Comments_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Comments_Table;
     15$wp_list_table->check_permissions();
    1616
    1717if ( isset( $_REQUEST['doaction'] ) ||  isset( $_REQUEST['doaction2'] ) || isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
     
    9898}
    9999
    100 $table->prepare_items();
     100$wp_list_table->prepare_items();
    101101
    102102wp_enqueue_script('admin-comments');
     
    258258<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
    259259
    260 <input type="hidden" name="_total" value="<?php echo esc_attr( $table->get_pagination_arg('total_items') ); ?>" />
    261 <input type="hidden" name="_per_page" value="<?php echo esc_attr( $table->get_pagination_arg('per_page') ); ?>" />
    262 <input type="hidden" name="_page" value="<?php echo esc_attr( $table->get_pagination_arg('page') ); ?>" />
     260<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
     261<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
     262<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
    263263
    264264<?php if ( isset($_REQUEST['paged']) ) { ?>
     
    266266<?php } ?>
    267267
    268 <?php if ( $table->has_items() ) { ?>
    269 
    270 <?php $table->display_table(); ?>
     268<?php if ( $wp_list_table->has_items() ) { ?>
     269
     270<?php $wp_list_table->display_table(); ?>
    271271
    272272<br class="clear" />
  • trunk/wp-admin/edit-tags.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Terms_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Terms_Table;
     15$wp_list_table->check_permissions();
    1616
    1717$title = $tax->labels->name;
     
    153153}
    154154
    155 $table->prepare_items();
     155$wp_list_table->prepare_items();
    156156
    157157wp_enqueue_script('admin-tags');
     
    242242<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
    243243
    244 <?php $table->display_table(); ?>
     244<?php $wp_list_table->display_table(); ?>
    245245
    246246<br class="clear" />
     
    352352</div><!-- /wrap -->
    353353
    354 <?php $table->inline_edit(); ?>
     354<?php $wp_list_table->inline_edit(); ?>
    355355
    356356<?php
  • trunk/wp-admin/edit.php

    r15511 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Posts_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Posts_Table;
     15$wp_list_table->check_permissions();
    1616
    1717// Back-compat for viewing comments of an entry
     
    120120}
    121121
    122 $table->prepare_items();
     122$wp_list_table->prepare_items();
    123123
    124124wp_enqueue_script('inline-edit-post');
     
    281281<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
    282282
    283 <?php $table->display(); ?>
     283<?php $wp_list_table->display(); ?>
    284284
    285285</form>
    286286
    287 <?php $table->inline_edit(); ?>
     287<?php $wp_list_table->inline_edit(); ?>
    288288
    289289<div id="ajax-response"></div>
  • 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}
  • trunk/wp-admin/includes/meta-boxes.php

    r15497 r15519  
    464464
    465465    require_once( './includes/default-list-tables.php' );
    466     $table = new WP_Comments_Table;
     466    $wp_list_table = new WP_Comments_Table;
    467467?>
    468468
    469469<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
    470470<thead><tr>
    471     <?php $table->print_column_headers(); ?>
     471    <?php $wp_list_table->print_column_headers(); ?>
    472472</tr></thead>
    473473<tbody id="the-comment-list" class="list:comment"></tbody>
  • trunk/wp-admin/includes/plugin-install.php

    r15491 r15519  
    163163 */
    164164function display_plugins_table() {
    165     global $table;
    166 
    167     $table->display();
     165    global $wp_list_table;
     166
     167    $wp_list_table->display();
    168168}
    169169add_action('install_plugins_search', 'display_plugins_table');
  • trunk/wp-admin/includes/template.php

    r15518 r15519  
    295295
    296296    require_once( './includes/default-list-tables.php' );
    297     $table = new WP_Comments_Table( 'reply' );
    298 
    299     $columns = $table->get_column_headers();
    300     $hidden = array_intersect( array_keys( $columns ), array_filter( $table->get_hidden_columns() ) );
     297    $wp_list_table = new WP_Comments_Table( 'reply' );
     298
     299    $columns = $wp_list_table->get_column_headers();
     300    $hidden = array_intersect( array_keys( $columns ), array_filter( $wp_list_table->get_hidden_columns() ) );
    301301    $col_count = count($columns) - count($hidden);
    302302
     
    12941294 */
    12951295function manage_columns_prefs( $page ) {
    1296     global $table;
    1297 
    1298     list( $columns, $hidden ) = $table->get_column_headers();
     1296    global $wp_list_table;
     1297
     1298    list( $columns, $hidden ) = $wp_list_table->get_column_headers();
    12991299
    13001300    $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username');
     
    16301630
    16311631function screen_meta($screen) {
    1632     global $wp_meta_boxes, $_wp_contextual_help, $title, $table;
     1632    global $wp_meta_boxes, $_wp_contextual_help, $title, $wp_list_table;
    16331633
    16341634    if ( is_string($screen) )
    16351635        $screen = convert_to_screen($screen);
    16361636
    1637     if ( is_a($table, 'WP_List_Table') )
    1638         list( $screen_columns ) = $table->get_column_headers();
     1637    if ( is_a($wp_list_table, 'WP_List_Table') )
     1638        list( $screen_columns ) = $wp_list_table->get_column_headers();
    16391639    $meta_screens = array('index' => 'dashboard');
    16401640
  • trunk/wp-admin/includes/theme-install.php

    r15491 r15519  
    262262 */
    263263function display_themes() {
    264     global $table;
    265 
    266     $table->display();
     264    global $wp_list_table;
     265
     266    $wp_list_table->display();
    267267}
    268268add_action('install_themes_search', 'display_themes');
  • trunk/wp-admin/link-manager.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Links_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Links_Table;
     15$wp_list_table->check_permissions();
    1616
    1717// Handle bulk deletes
     
    3636}
    3737
    38 $table->prepare_items();
     38$wp_list_table->prepare_items();
    3939
    4040$title = __('Links');
     
    8585
    8686<form id="posts-filter" action="" method="post">
    87 <?php $table->display(); ?>
     87<?php $wp_list_table->display(); ?>
    8888<div id="ajax-response"></div>
    8989</form>
  • trunk/wp-admin/network/sites.php

    r15496 r15519  
    1515require_once( '../includes/default-list-tables.php' );
    1616
    17 $table = new WP_Sites_Table;
    18 $table->check_permissions();
     17$wp_list_table = new WP_Sites_Table;
     18$wp_list_table->check_permissions();
    1919
    2020$title = __( 'Sites' );
     
    351351    case 'list':
    352352    default:
    353         $table->prepare_items();
     353        $wp_list_table->prepare_items();
    354354
    355355        require_once( '../admin-header.php' );
     
    379379
    380380        <form id="form-site-list" action="edit.php?action=allblogs" method="post">
    381             <?php $table->display(); ?>
     381            <?php $wp_list_table->display(); ?>
    382382        </form>
    383383        </div>
  • trunk/wp-admin/network/users.php

    r15496 r15519  
    1212require_once( '../includes/default-list-tables.php' );
    1313
    14 $table = new WP_MS_Users_Table;
    15 $table->check_permissions();
    16 $table->prepare_items();
     14$wp_list_table = new WP_MS_Users_Table;
     15$wp_list_table->check_permissions();
     16$wp_list_table->prepare_items();
    1717
    1818$title = __( 'Users' );
     
    7979
    8080    <form id="form-user-list" action='edit.php?action=allusers' method='post'>
    81         <?php $table->display(); ?>
     81        <?php $wp_list_table->display(); ?>
    8282    </form>
    8383</div>
  • trunk/wp-admin/plugin-install.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Plugin_Install_Table;
    15 $table->check_permissions();
    16 $table->prepare_items();
     14$wp_list_table = new WP_Plugin_Install_Table;
     15$wp_list_table->check_permissions();
     16$wp_list_table->prepare_items();
    1717
    1818$title = __('Install Plugins');
  • trunk/wp-admin/plugins.php

    r15496 r15519  
    1212require_once( ABSPATH . 'wp-admin/includes/default-list-tables.php' );
    1313
    14 $table = new WP_Plugins_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Plugins_Table;
     15$wp_list_table->check_permissions();
    1616
    1717if ( isset($_POST['clear-recent-list']) )
     
    303303    update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
    304304
    305 $table->prepare_items();
     305$wp_list_table->prepare_items();
    306306
    307307wp_enqueue_script('plugin-install');
     
    439439?>
    440440
    441 <?php $table->display(); ?>
     441<?php $wp_list_table->display(); ?>
    442442</form>
    443443
  • trunk/wp-admin/theme-install.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Theme_Install_Table;
    15 $table->check_permissions();
    16 $table->prepare_items();
     14$wp_list_table = new WP_Theme_Install_Table;
     15$wp_list_table->check_permissions();
     16$wp_list_table->prepare_items();
    1717
    1818$title = __('Install Themes');
  • trunk/wp-admin/themes.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Themes_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Themes_Table;
     15$wp_list_table->check_permissions();
    1616
    1717if ( current_user_can('switch_themes') && isset($_GET['action']) ) {
     
    3131}
    3232
    33 $table->prepare_items();
     33$wp_list_table->prepare_items();
    3434
    3535$title = __('Manage Themes');
     
    106106<h3><?php _e('Available Themes'); ?></h3>
    107107
    108 <?php $table->display(); ?>
     108<?php $wp_list_table->display(); ?>
    109109
    110110<br class="clear" />
  • trunk/wp-admin/upload.php

    r15496 r15519  
    1212require_once( './includes/default-list-tables.php' );
    1313
    14 $table = new WP_Media_Table;
    15 $table->check_permissions();
     14$wp_list_table = new WP_Media_Table;
     15$wp_list_table->check_permissions();
    1616
    1717// Handle bulk actions
     
    131131}
    132132
    133 $table->prepare_items();
     133$wp_list_table->prepare_items();
    134134
    135135$title = __('Media Library');
     
    248248
    249249<form id="posts-filter" action="" method="post">
    250 <?php $table->display(); ?>
     250<?php $wp_list_table->display(); ?>
    251251<div id="ajax-response"></div>
    252252<?php find_posts_div(); ?>
  • trunk/wp-admin/users.php

    r15496 r15519  
    1515require_once( './includes/default-list-tables.php' );
    1616
    17 $table = new WP_Users_Table;
    18 $table->check_permissions();
     17$wp_list_table = new WP_Users_Table;
     18$wp_list_table->check_permissions();
    1919
    2020$title = __('Users');
     
    309309    }
    310310
    311     $table->prepare_items();
     311    $wp_list_table->prepare_items();
    312312
    313313    include('./admin-header.php');
     
    413413
    414414<form id="posts-filter" action="" method="post">
    415 <?php $table->display(); ?>
     415<?php $wp_list_table->display(); ?>
    416416</form>
    417417
Note: See TracChangeset for help on using the changeset viewer.