WordPress.org

Make WordPress Core

Ticket #4839: wp_set_comment_status.diff

File wp_set_comment_status.diff, 592 bytes (added by filosofo, 11 years ago)
  • wp-includes/comment.php

     
    492492        $rval = $wpdb->rows_affected;
    493493
    494494        clean_comment_cache($comment_ID);
     495        if ( $comment['comment_approved'] != $comment_status ) {
     496                $status = array( 0 => 'hold', 1 => 'approve', 'spam' => 'spam' );               
     497                do_action('wp_set_comment_status', $comment_ID, $status[$comment_status]);
     498        }
    495499        wp_update_comment_count($comment_post_ID);
    496500        do_action('edit_comment', $comment_ID);
    497501        return $rval;