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

git-svn-id: http://core.svn.wordpress.org/trunk@22370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-05 16:49:10 +00:00
parent 903714254c
commit e79b028a08
1 changed files with 6 additions and 6 deletions

View File

@ -749,12 +749,6 @@ function wp_ajax_replyto_comment( $action ) {
$comment_auto_approved = false;
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
$comment_id = wp_new_comment( $commentdata );
$comment = get_comment($comment_id);
if ( ! $comment ) wp_die( 1 );
$position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
// automatically approve parent comment
if ( !empty($_POST['approve_parent']) ) {
$parent = get_comment( $comment_parent );
@ -765,6 +759,12 @@ function wp_ajax_replyto_comment( $action ) {
}
}
$comment_id = wp_new_comment( $commentdata );
$comment = get_comment($comment_id);
if ( ! $comment ) wp_die( 1 );
$position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
ob_start();
if ( 'dashboard' == $_REQUEST['mode'] ) {
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );