Changeset 16371
- Timestamp:
- 11/14/2010 06:19:45 PM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r16369 r16371 520 520 } 521 521 522 if ( isset($_POST['screen']) ) 523 set_current_screen($_POST['screen']); 522 set_current_screen( $_POST['screen'] ); 524 523 525 524 $wp_list_table = get_list_table('WP_Terms_List_Table'); … … 582 581 exit; 583 582 break; 584 case 'add-comment' :585 check_ajax_referer( $action );586 if ( !current_user_can( 'edit_posts' ) )587 die('-1');588 589 $wp_list_table = get_list_table('WP_Comments_List_Table');590 $wp_list_table->from_ajax = true;591 592 $wp_list_table->prepare_items();593 594 if ( !$wp_list_table->has_items() )595 die('1');596 597 $x = new WP_Ajax_Response();598 foreach ( $wp_list_table->items as $comment ) {599 ob_start();600 $wp_list_table->single_row( $comment );601 $comment_list_item = ob_get_contents();602 ob_end_clean();603 $x->add( array(604 'what' => 'comment',605 'id' => $comment->comment_ID,606 'data' => $comment_list_item607 ) );608 }609 $x->send();610 break;611 583 case 'get-comments' : 612 584 check_ajax_referer( $action ); … … 615 587 if ( !current_user_can( 'edit_post', $post_ID ) ) 616 588 die('-1'); 589 590 set_current_screen( 'edit-comments' ); 617 591 618 592 $wp_list_table = get_list_table('WP_Post_Comments_List_Table'); … … 1162 1136 } 1163 1137 1164 if ( isset($_POST['screen']) ) 1165 set_current_screen($_POST['screen']); 1138 set_current_screen( $_POST['screen'] ); 1166 1139 1167 1140 if ( $last = wp_check_post_lock( $post_ID ) ) { … … 1210 1183 check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 1211 1184 1212 set_current_screen( 'edit-' . $_POST['taxonomy']);1185 set_current_screen( 'edit-' . $_POST['taxonomy'] ); 1213 1186 1214 1187 $wp_list_table = get_list_table('WP_Terms_List_Table'); -
trunk/wp-admin/includes/class-wp-comments-list-table.php
r16356 r16371 18 18 19 19 var $checkbox = true; 20 var $from_ajax = false;21 20 22 21 var $pending_count = array(); … … 412 411 413 412 // Reply and quickedit need a hide-if-no-js span when not added with ajax 414 if ( ( 'reply' == $action || 'quickedit' == $action ) && ! $this->from_ajax)413 if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') ) 415 414 $action .= ' hide-if-no-js'; 416 415 elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.