diff --git a/src/wp-includes/comment-functions.php b/src/wp-includes/comment-functions.php index abe8291613..7b76dbedeb 100644 --- a/src/wp-includes/comment-functions.php +++ b/src/wp-includes/comment-functions.php @@ -237,6 +237,8 @@ function get_comment_statuses() { 'approve' => _x('Approved', 'adjective'), /* translators: comment status */ 'spam' => _x('Spam', 'adjective'), + /* translators: comment status */ + 'trash' => _x('Trash', 'adjective'), ); return $status; diff --git a/tests/phpunit/tests/xmlrpc/wp/editComment.php b/tests/phpunit/tests/xmlrpc/wp/editComment.php new file mode 100644 index 0000000000..d6ba91fdfc --- /dev/null +++ b/tests/phpunit/tests/xmlrpc/wp/editComment.php @@ -0,0 +1,29 @@ +make_user_by_role( 'administrator' ); + $post_id = $this->factory->post->create(); + + $comment_data = array( + 'comment_post_ID' => $post_id, + 'comment_author' => 'Test commenter', + 'comment_author_url' => 'http://example.com/', + 'comment_author_email' => 'example@example.com', + 'comment_content' => rand_str( 100 ), + 'comment_approved' => '1' + ); + $comment_id = wp_insert_comment( $comment_data ); + + $this->assertEquals( '1', get_comment( $comment_id )->comment_approved ); + + $this->myxmlrpcserver->wp_editComment( array( 1, 'administrator', 'administrator', $comment_id, array( + 'status' => 'trash' + ) ) ); + + $this->assertEquals( 'trash', get_comment( $comment_id )->comment_approved ); + } +} \ No newline at end of file