WordPress.org

Make WordPress Core

Ticket #16252: 16252.diff

File 16252.diff, 3.3 KB (added by MattyRob, 8 years ago)
  • wp-admin/edit-form-comment.php

     
    105105                } ?></td>
    106106        <td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" tabindex="3" /></td>
    107107</tr>
     108<tr valign="top">
     109        <td class="first">
     110        <?php _e( 'Comment Parent' );?>
     111        </td>
     112        <td>
     113        <input type="text" id="newcomment_parent" name="newcomment_parent" size="5" class="code" value="<?php echo esc_attr($comment->comment_parent); ?>" tabindex="4" />
     114        </td>
     115</tr>
    108116</tbody>
    109117</table>
    110118<br />
  • wp-admin/includes/comment.php

     
    4242        $_POST['comment_approved'] = $_POST['comment_status'];
    4343        $_POST['comment_content'] = $_POST['content'];
    4444        $_POST['comment_ID'] = (int) $_POST['comment_ID'];
     45        $_POST['comment_parent'] = (int) $_POST['newcomment_parent'];
    4546
    4647        foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
    4748                if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
     
    8990        $comment->comment_author_email = format_to_edit( $comment->comment_author_email );
    9091        $comment->comment_author_url = format_to_edit( $comment->comment_author_url );
    9192        $comment->comment_author_url = esc_url($comment->comment_author_url);
     93        $comment->comment_parent =(int) $comment->comment_parent;
    9294
    9395        return $comment;
    9496}
  • wp-includes/comment.php

     
    13351335 * @uses wp_filter_comment() Used to filter comment before adding comment.
    13361336 * @uses wp_allow_comment() checks to see if comment is approved.
    13371337 * @uses wp_insert_comment() Does the actual comment insertion to the database.
     1338 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object
    13381339 *
    13391340 * @param array $commentdata Contains information on the comment.
    13401341 * @return int The ID of the comment after adding.
     
    13651366        $comment_ID = wp_insert_comment($commentdata);
    13661367
    13671368        do_action('comment_post', $comment_ID, $commentdata['comment_approved']);
     1369        wp_transition_comment_status($commentdata['comment_approved'], 'new', (object)$commentdata);
    13681370
    13691371        if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
    13701372                if ( '0' == $commentdata['comment_approved'] )
     
    14831485        else if ( 'approve' == $comment_approved )
    14841486                $comment_approved = 1;
    14851487
    1486         $data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt');
     1488        $data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_parent');
    14871489        $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
    14881490
    14891491        clean_comment_cache($comment_ID);