Fix status transitions from edit comment form. Props josephscott. fixes #8863
git-svn-id: https://develop.svn.wordpress.org/trunk@11124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0b9998f037
commit
3e6b3326c8
|
@ -1089,6 +1089,8 @@ function wp_update_comment($commentarr) {
|
||||||
// Escape data pulled from DB.
|
// Escape data pulled from DB.
|
||||||
$comment = $wpdb->escape($comment);
|
$comment = $wpdb->escape($comment);
|
||||||
|
|
||||||
|
$old_status = $comment['comment_approved'];
|
||||||
|
|
||||||
// Merge old and new fields with new fields overwriting old ones.
|
// Merge old and new fields with new fields overwriting old ones.
|
||||||
$commentarr = array_merge($comment, $commentarr);
|
$commentarr = array_merge($comment, $commentarr);
|
||||||
|
|
||||||
|
@ -1117,7 +1119,7 @@ function wp_update_comment($commentarr) {
|
||||||
wp_update_comment_count($comment_post_ID);
|
wp_update_comment_count($comment_post_ID);
|
||||||
do_action('edit_comment', $comment_ID);
|
do_action('edit_comment', $comment_ID);
|
||||||
$comment = get_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;
|
return $rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue