Changeset 38455
- Timestamp:
- 08/30/2016 08:06:30 PM (8 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r38411 r38455 80 80 * 81 81 * @since 3.1.0 82 *83 * @global WP_List_Table $wp_list_table84 82 */ 85 83 function wp_ajax_fetch_list() { 86 global $wp_list_table;87 88 84 $list_class = $_GET['list_args']['class']; 89 85 check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' ); 90 86 91 87 $wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) ); 92 if ( ! $wp_list_table ) 88 if ( ! $wp_list_table ) { 93 89 wp_die( 0 ); 94 95 if ( ! $wp_list_table->ajax_user_can() ) 96 wp_die( -1 ); 90 } 91 92 if ( ! $wp_list_table->ajax_user_can() ) { 93 wp_die( -1 ); 94 } 97 95 98 96 $wp_list_table->ajax_response(); … … 830 828 * 831 829 * @since 3.1.0 832 *833 * @global WP_List_Table $wp_list_table834 830 */ 835 831 function wp_ajax_add_tag() { 836 global $wp_list_table;837 838 832 check_ajax_referer( 'add-tag', '_wpnonce_add-tag' ); 839 833 $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; … … 934 928 * @since 3.1.0 935 929 * 936 * @global WP_List_Table $wp_list_table937 930 * @global int $post_id 938 931 * … … 940 933 */ 941 934 function wp_ajax_get_comments( $action ) { 942 global $ wp_list_table, $post_id;943 if ( empty( $action ) ) 935 global $post_id; 936 if ( empty( $action ) ) { 944 937 $action = 'get-comments'; 945 938 } 946 939 check_ajax_referer( $action ); 947 940 948 941 if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) { 949 942 $id = absint( $_REQUEST['p'] ); 950 if ( ! empty( $id ) ) 943 if ( ! empty( $id ) ) { 951 944 $post_id = $id; 952 } 953 954 if ( empty( $post_id ) ) 955 wp_die( -1 ); 945 } 946 } 947 948 if ( empty( $post_id ) ) { 949 wp_die( -1 ); 950 } 956 951 957 952 $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) ); 958 953 959 if ( ! current_user_can( 'edit_post', $post_id ) ) 960 wp_die( -1 ); 954 if ( ! current_user_can( 'edit_post', $post_id ) ) { 955 wp_die( -1 ); 956 } 961 957 962 958 $wp_list_table->prepare_items(); 963 959 964 if ( ! $wp_list_table->has_items() )960 if ( ! $wp_list_table->has_items() ) { 965 961 wp_die( 1 ); 962 } 966 963 967 964 $x = new WP_Ajax_Response(); … … 987 984 * @since 3.1.0 988 985 * 989 * @global WP_List_Table $wp_list_table990 *991 986 * @param string $action Action to perform. 992 987 */ 993 988 function wp_ajax_replyto_comment( $action ) { 994 global $wp_list_table;995 989 if ( empty( $action ) ) 996 990 $action = 'replyto-comment'; … … 1109 1103 * 1110 1104 * @since 3.1.0 1111 *1112 * @global WP_List_Table $wp_list_table1113 1105 */ 1114 1106 function wp_ajax_edit_comment() { 1115 global $wp_list_table;1116 1117 1107 check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ); 1118 1108 … … 1328 1318 * @since 3.1.0 1329 1319 * 1330 * @global WP_List_Table $wp_list_table1331 *1332 1320 * @param string $action Action to perform. 1333 1321 */ 1334 1322 function wp_ajax_add_user( $action ) { 1335 global $wp_list_table; 1336 if ( empty( $action ) ) 1323 if ( empty( $action ) ) { 1337 1324 $action = 'add-user'; 1325 } 1338 1326 1339 1327 check_ajax_referer( $action ); … … 1608 1596 * 1609 1597 * @since 3.1.0 1610 *1611 * @global WP_List_Table $wp_list_table1612 1598 */ 1613 1599 function wp_ajax_inline_save() { 1614 global $ wp_list_table, $mode;1600 global $mode; 1615 1601 1616 1602 check_ajax_referer( 'inlineeditnonce', '_inline_edit' ); … … 1708 1694 * 1709 1695 * @since 3.1.0 1710 *1711 * @global WP_List_Table $wp_list_table1712 1696 */ 1713 1697 function wp_ajax_inline_save_tax() { 1714 global $wp_list_table;1715 1716 1698 check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 1717 1699 -
trunk/src/wp-admin/includes/list-table.php
r38411 r38455 64 64 */ 65 65 function register_column_headers($screen, $columns) { 66 $wp_list_table = new _WP_List_Table_Compat($screen, $columns);66 new _WP_List_Table_Compat( $screen, $columns ); 67 67 } 68 68
Note: See TracChangeset
for help on using the changeset viewer.