From 606b6197b5d98e064cf574cadd8d866d50a492c6 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 1 Oct 2009 19:59:35 +0000 Subject: [PATCH] Delete the trash metadata when untrashing a comment. See #4529 props caesarsgrunt. git-svn-id: http://svn.automattic.com/wordpress/trunk@11992 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 7f296585e1..8760d81028 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -890,8 +890,11 @@ function wp_untrash_comment($comment_id = 0) { //Either set comment_approved to the value in comment_meta or worse case to false which will mean moderation $comment['comment_approved'] = get_comment_meta($comment_id, '_wp_trash_meta_status', true); + delete_comment_meta($comment_id, '_wp_trash_meta_time'); + delete_comment_meta($comment_id, '_wp_trash_meta_status'); + wp_update_comment($comment); - + do_action('untrashed_comment', $comment_id); return true;