diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 0ff181c558..d422664c27 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -137,35 +137,6 @@ if ( 'spam' == $_GET['dt'] ) { break; case 'deletecomment' : - $comment_id = absint( $_REQUEST['c'] ); - check_admin_referer( 'delete-comment_' . $comment_id ); - - if ( isset( $_REQUEST['noredir'] ) ) - $noredir = true; - else - $noredir = false; - - if ( !$comment = get_comment( $comment_id ) ) - comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit-comments.php') ); - - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - comment_footer_die( __('You are not allowed to edit comments on this post.') ); - - if ( 'spam' == $_REQUEST['dt'] ) - wp_set_comment_status( $comment->comment_ID, 'spam' ); - else - wp_delete_comment( $comment->comment_ID ); - - if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) ) - wp_redirect( wp_get_referer() ); - else if ( '' != wp_get_original_referer() && false == $noredir ) - wp_redirect( wp_get_original_referer() ); - else - wp_redirect( admin_url('edit-comments.php') ); - - die; - break; - case 'trashcomment' : case 'untrashcomment' : case 'spamcomment' : @@ -190,6 +161,10 @@ case 'unspamcomment' : $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir ); switch ( $action ) { + case 'deletecomment' : + wp_delete_comment($comment_id); + $redir = add_query_arg( array('deleted' => '1'), $redir ); + break; case 'trashcomment' : wp_trash_comment($comment_id); $redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir ); diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index f69fdd3a53..6137a93c14 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -545,7 +545,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); - $spam_url = esc_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); + $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );