WordPress.org

Make WordPress Core

Ticket #4387: comment.03.patch

File comment.03.patch, 947 bytes (added by hovenko, 7 years ago)

Fix: previous patch cleared the cache too late. Fix: edit_comments function can also update the comment status, so it should call on the action wp_set_comment_status

  • crypto/home/hovenko/workspace/NRK

     
    436436        if ( !$wpdb->query($query) ) 
    437437                return false; 
    438438 
     439        unset($comment_cache[$comment_id]); 
    439440        do_action('wp_set_comment_status', $comment_id, $comment_status); 
    440         unset($comment_cache[$comment_id]); 
    441441        $comment = get_comment($comment_id); 
    442442        wp_update_comment_count($comment->comment_post_ID); 
    443443        return true; 
     
    480480        $rval = $wpdb->rows_affected; 
    481481        unset($comment_cache[$comment_ID]); 
    482482        wp_update_comment_count($comment_post_ID); 
     483        do_action('wp_set_comment_status', $comment_ID, wp_get_comment_status($comment_ID)); 
    483484        do_action('edit_comment', $comment_ID); 
    484485        return $rval; 
    485486}