From 7f10cf48142eb482269631df1ae6fbbdedb85bfc Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 15 Nov 2011 14:02:42 +0000 Subject: [PATCH] Don't show edit links for spam comments. Props DH-Shredder. fixes #18340 git-svn-id: http://svn.automattic.com/wordpress/trunk@19296 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/comment.php | 3 +++ wp-admin/includes/class-wp-comments-list-table.php | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index bcdc859a49..cd948ebf0e 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -69,6 +69,9 @@ case 'editcomment' : if ( 'trash' == $comment->comment_approved ) comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') ); + if ( 'spam' == $comment->comment_approved ) + comment_footer_die( __('This comment is marked as Spam. Please mark it as Not Spam if you want to edit it.') ); + $comment = get_comment_to_edit( $comment_id ); include('./edit-form-comment.php'); diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index e14ad2aa7b..e3dc4c48b7 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -411,11 +411,10 @@ class WP_Comments_List_Table extends WP_List_Table { $actions['trash'] = "" . _x( 'Trash', 'verb' ) . ''; } - if ( 'trash' != $the_comment_status ) { + if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { $actions['edit'] = "". __( 'Edit' ) . ''; $actions['quickedit'] = '' . __( 'Quick Edit' ) . ''; - if ( 'spam' != $the_comment_status ) - $actions['reply'] = '' . __( 'Reply' ) . ''; + $actions['reply'] = '' . __( 'Reply' ) . ''; } $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );