Changeset 18100
- Timestamp:
- 06/01/2011 07:23:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r18010 r18100 661 661 662 662 $comment_parent = absint($_POST['comment_ID']); 663 $comment_auto_approved = false; 663 664 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 664 665 … … 668 669 669 670 $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1'; 671 672 673 // automatically approve parent comment 674 if ( !empty($_POST['approve_parent']) ) { 675 $parent = get_comment( $comment_parent ); 676 677 if ( $parent && $parent->comment_approved === '0' && $parent->comment_post_ID == $comment_post_ID ) { 678 if ( wp_set_comment_status( $parent->comment_ID, 'approve' ) ) 679 $comment_auto_approved = true; 680 } 681 } 670 682 671 683 ob_start(); … … 691 703 ); 692 704 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 } 705 if ( $comment_auto_approved ) 706 $response['supplemental'] = array( 'parent_approved' => $parent->comment_ID ); 702 707 703 708 $x = new WP_Ajax_Response();
Note: See TracChangeset
for help on using the changeset viewer.