X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/449d082fcc4873c1f7d363a0d9f7409be7f6e77d..1c09677af04c9e37714e09b73eb9dbc5b2e3eb13:/wp-admin/comment.php
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
index 129d6211..8b63a57a 100644
--- a/wp-admin/comment.php
+++ b/wp-admin/comment.php
@@ -17,12 +17,24 @@ 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.
*
* @param string $msg Error Message. Assumed to contain HTML and be sanitized.
*/
-function comment_footer_die( $msg ) { //
+function comment_footer_die( $msg ) {
echo "
";
include('admin-footer.php');
die;
@@ -44,68 +56,60 @@ case 'editcomment' :
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
comment_footer_die( __('You are not allowed to edit comments on this post.') );
+ 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.') );
+
$comment = get_comment_to_edit( $comment_id );
include('edit-form-comment.php');
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.') );
?>