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

git-svn-id: https://develop.svn.wordpress.org/trunk@22370 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-05 16:49:10 +00:00
parent 502908fa4c
commit 52e69011ad
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' );