WordPress.org

Make WordPress Core

Ticket #8863: 8863.patch

File 8863.patch, 892 bytes (added by hakre, 9 years ago)
  • wp-includes/comment.php

     
    11161116                        return false;
    11171117        }
    11181118
     1119        $comment_old = get_comment($comment_id);
     1120
    11191121        if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) {
    11201122                if ( $wp_error )
    11211123                        return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error);
     
    11281130        $comment = get_comment($comment_id);
    11291131
    11301132        do_action('wp_set_comment_status', $comment_id, $comment_status);
    1131         wp_transition_comment_status($comment_status, $comment->comment_approved, $comment);
     1133        wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
    11321134
    11331135        wp_update_comment_count($comment->comment_post_ID);
    11341136