From 1d2a1111a0c0e8f05ed5d36be647a196e9c15465 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 29 Apr 2009 17:22:08 +0000 Subject: [PATCH] Fix status transitions from edit comment form. Props josephscott. fixes #8863 git-svn-id: http://svn.automattic.com/wordpress/trunk@11124 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 7a1ba8bbc..b6011169a 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1089,6 +1089,8 @@ function wp_update_comment($commentarr) { // Escape data pulled from DB. $comment = $wpdb->escape($comment); + $old_status = $comment['comment_approved']; + // Merge old and new fields with new fields overwriting old ones. $commentarr = array_merge($comment, $commentarr); @@ -1117,7 +1119,7 @@ function wp_update_comment($commentarr) { wp_update_comment_count($comment_post_ID); do_action('edit_comment', $comment_ID); $comment = get_comment($comment_ID); - wp_transition_comment_status($comment_approved, $comment->comment_approved, $comment); + wp_transition_comment_status($comment->comment_approved, $old_status, $comment); return $rval; }