From c8936195f6b28859474569c8febc8246dc62d2b4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 29 Jun 2014 23:19:16 +0000 Subject: [PATCH] Allow comments in the trash to marked as spam. Props mordauk. Fixes #19256. Built from https://develop.svn.wordpress.org/trunk@28913 git-svn-id: http://core.svn.wordpress.org/trunk@28712 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-comments-list-table.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index f9cde7ecf5..5b901c3369 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -209,7 +209,7 @@ class WP_Comments_List_Table extends WP_List_Table { $actions['unapprove'] = __( 'Unapprove' ); if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) $actions['approve'] = __( 'Approve' ); - if ( in_array( $comment_status, array( 'all', 'moderated', 'approved' ) ) ) + if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) $actions['spam'] = _x( 'Mark as Spam', 'comment' ); if ( 'trash' == $comment_status ) @@ -444,11 +444,13 @@ class WP_Comments_List_Table extends WP_List_Table { $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; } - if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { + if ( 'spam' != $the_comment_status ) { $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; } elseif ( 'spam' == $the_comment_status ) { $actions['unspam'] = "" . _x( 'Not Spam', 'comment' ) . ''; - } elseif ( 'trash' == $the_comment_status ) { + } + + if ( 'trash' == $the_comment_status ) { $actions['untrash'] = "" . __( 'Restore' ) . ''; }