WordPress.org

Make WordPress Core

Ticket #1953: comment_parent.diff

File comment_parent.diff, 896 bytes (added by error, 16 years ago)

Set new DB field $comment_parent when comment posted.

  • wp-comments-post.php

     
    44nocache_headers();
    55
    66$comment_post_ID = (int) $_POST['comment_post_ID'];
     7$comment_parent = (int) $_POST['comment_parent'];
    78
    89$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
    910
     
    4647if ( '' == $comment_content )
    4748        die( __('Error: please type a comment.') );
    4849
    49 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');
     50$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
    5051
    5152wp_new_comment( $commentdata );
    5253