WordPress.org

Make WordPress Core

Ticket #16365: 16365v4.diff

File 16365v4.diff, 1.0 KB (added by MattyRob, 4 years ago)
  • wp-includes/comment.php

     
    13171317 * @uses wp_filter_comment() Used to filter comment before adding comment. 
    13181318 * @uses wp_allow_comment() checks to see if comment is approved. 
    13191319 * @uses wp_insert_comment() Does the actual comment insertion to the database. 
     1320 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 
    13201321 * 
    13211322 * @param array $commentdata Contains information on the comment. 
    13221323 * @return int The ID of the comment after adding. 
     
    13471348        $comment_ID = wp_insert_comment($commentdata); 
    13481349 
    13491350        do_action('comment_post', $comment_ID, $commentdata['comment_approved']); 
     1351        wp_transition_comment_status($commentdata['comment_approved'], 'new', (object)$commentdata); 
    13501352 
    13511353        if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching 
    13521354                if ( '0' == $commentdata['comment_approved'] )