Changeset 34129 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 09/14/2015 09:39:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r34074 r34129 521 521 522 522 check_ajax_referer( "delete-comment_$id" ); 523 $status = wp_get_comment_status( $comment ->comment_ID);523 $status = wp_get_comment_status( $comment ); 524 524 525 525 $delta = -1; … … 731 731 wp_die( -1 ); 732 732 733 $current = wp_get_comment_status( $comment ->comment_ID);733 $current = wp_get_comment_status( $comment ); 734 734 if ( isset( $_POST['new'] ) && $_POST['new'] == $current ) 735 735 wp_die( time() ); 736 736 737 737 check_ajax_referer( "approve-comment_$id" ); 738 if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) 739 $result = wp_set_comment_status( $comment->comment_ID, 'approve', true ); 740 else 741 $result = wp_set_comment_status( $comment->comment_ID, 'hold', true ); 738 if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) { 739 $result = wp_set_comment_status( $comment, 'approve', true ); 740 } else { 741 $result = wp_set_comment_status( $comment, 'hold', true ); 742 } 742 743 743 744 if ( is_wp_error($result) ) { … … 1016 1017 } 1017 1018 1018 if ( wp_set_comment_status( $parent ->comment_ID, 'approve' ) )1019 if ( wp_set_comment_status( $parent, 'approve' ) ) 1019 1020 $comment_auto_approved = true; 1020 1021 }
Note: See TracChangeset
for help on using the changeset viewer.