Make WordPress Core

Changeset 22370


Ignore:
Timestamp:
11/05/2012 04:49:10 PM (12 years ago)
Author:
nacin
Message:

When approving and then replying to a comment, approve the parent comment before inserting the reply. props trepmal, fixes #22000.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r22212 r22370  
    750750    $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
    751751
    752     $comment_id = wp_new_comment( $commentdata );
    753     $comment = get_comment($comment_id);
    754     if ( ! $comment ) wp_die( 1 );
    755 
    756     $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
    757 
    758752    // automatically approve parent comment
    759753    if ( !empty($_POST['approve_parent']) ) {
     
    765759        }
    766760    }
     761
     762    $comment_id = wp_new_comment( $commentdata );
     763    $comment = get_comment($comment_id);
     764    if ( ! $comment ) wp_die( 1 );
     765
     766    $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
    767767
    768768    ob_start();
Note: See TracChangeset for help on using the changeset viewer.