Changeset 17832 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 05/07/2011 04:56:00 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r17831 r17832 667 667 if ( ! $comment ) die('1'); 668 668 669 $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 670 671 $x = new WP_Ajax_Response(); 669 $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1'; 672 670 673 671 ob_start(); … … 686 684 ob_end_clean(); 687 685 688 $ x->add(array(686 $response = array( 689 687 'what' => 'comment', 690 688 'id' => $comment->comment_ID, 691 689 'data' => $comment_list_item, 692 690 'position' => $position 693 )); 694 691 ); 692 693 // automatically approve parent comment 694 if ( !empty($_POST['approve_parent']) ) { 695 $parent = get_comment( $comment_parent ); 696 697 if ( $parent && $parent->comment_approved === '0' && $parent->comment_post_ID == $comment_post_ID ) { 698 if ( wp_set_comment_status( $parent->comment_ID, 'approve' ) ) 699 $response['supplemental'] = array( 'parent_approved' => $parent->comment_ID ); 700 } 701 } 702 703 $x = new WP_Ajax_Response(); 704 $x->add( $response ); 695 705 $x->send(); 696 706 break;
Note: See TracChangeset
for help on using the changeset viewer.