diff --git a/wp-admin/comment.php b/wp-admin/comment.php index d422664c27..8b63a57a27 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -17,6 +17,18 @@ wp_reset_vars( array('action') ); if ( isset( $_POST['deletecomment'] ) ) $action = 'deletecomment'; +if ( 'cdc' == $action ) + $action = 'delete'; +elseif ( 'mac' == $action ) + $action = 'approve'; + +if ( isset( $_GET['dt'] ) ) { + if ( 'spam' == $_GET['dt'] ) + $action = 'spam'; + elseif ( 'trash' == $_GET['dt'] ) + $action = 'trash'; +} + /** * Display error message at bottom of comments. * @@ -53,62 +65,51 @@ case 'editcomment' : break; -case 'cdc' : -case 'mac' : +case 'delete' : +case 'approve' : +case 'trash' : +case 'spam' : require_once('admin-header.php'); $comment_id = absint( $_GET['c'] ); - $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; - $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; + $formaction = $action . 'comment'; + $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_'; $nonce_action .= $comment_id; if ( !$comment = get_comment_to_edit( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); + comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); ?>
- - - - -
comment_author; ?> | @@ -131,6 +132,24 @@ if ( 'spam' == $_GET['dt'] ) {