Make WordPress Core


Ignore:
Timestamp:
08/25/2010 12:51:44 AM (14 years ago)
Author:
scribu
Message:

Introduce get_list_table(). See #14579

File:
1 edited

Legend:

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

    r15519 r15528  
    5252switch ( $action = $_GET['action'] ) :
    5353case 'fetch-list' :
    54     require_once( './includes/default-list-tables.php' );
     54    require_once( ABSPATH . '/wp-admin/includes/default-list-tables.php' );
    5555
    5656    $class = $_GET['list_args']['class'];
    5757
    5858    if ( class_exists( $class ) ) {
    59         global $current_screen;
    6059        $current_screen = (object) $_GET['list_args']['screen'];
    6160        $wp_list_table = new $class;
     
    558557        set_current_screen($_POST['screen']);
    559558
    560     require_once( './includes/default-list-tables.php' );
    561     $wp_list_table = new WP_Terms_Table();
     559    $wp_list_table = get_list_table('terms');
    562560
    563561    $level = 0;
     
    626624        die('-1');
    627625
    628     require_once( './includes/default-list-tables.php' );
    629     $wp_list_table = new WP_Comments_Table();
     626    $wp_list_table = get_list_table('comments');
    630627    $wp_list_table->prepare_items();
    631628
     
    655652        die('-1');
    656653
    657     require_once( './includes/default-list-tables.php' );
    658     $wp_list_table = new WP_Comments_Table();
     654    $wp_list_table = get_list_table('comments');
    659655    $wp_list_table->prepare_items();
    660656
     
    680676    check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
    681677
    682     require_once( './includes/default-list-tables.php' );
    683     $wp_list_table = new WP_Comments_Table();
     678    $wp_list_table = get_list_table('comments');
    684679
    685680    $comment_post_ID = (int) $_POST['comment_post_ID'];
     
    762757    $comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
    763758
    764     require_once( './includes/default-list-tables.php' );
    765     $wp_list_table = new WP_Comments_Table();
     759    $wp_list_table = get_list_table('comments');
    766760
    767761    ob_start();
     
    911905    $user_object = new WP_User( $user_id );
    912906
    913     require_once( './includes/default-list-tables.php' );
    914     $wp_list_table = new WP_Users_Table();
     907    $wp_list_table = get_list_table('users');
    915908
    916909    $x = new WP_Ajax_Response( array(
     
    12041197    edit_post();
    12051198
    1206     require_once( './includes/default-list-tables.php' );
    1207     $wp_list_table = new WP_Posts_Table();
     1199    $wp_list_table = get_list_table('posts');
    12081200
    12091201    $mode = $_POST['post_view'];
     
    12151207    check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
    12161208
    1217     require_once( './includes/default-list-tables.php' );
    1218     $wp_list_table = new WP_Terms_Table();
     1209    $wp_list_table = get_list_table('terms');
    12191210
    12201211    $wp_list_table->check_permissions('edit');
Note: See TracChangeset for help on using the changeset viewer.