diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 557bcfd37..bee82259e 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -41,23 +41,27 @@ case 'editcomment': break; case 'confirmdeletecomment': +case 'mailapprovecomment': require_once('./admin-header.php'); $comment = (int) $_GET['comment']; $p = (int) $_GET['p']; + $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - die( __('You are not allowed to delete comments on this post.') ); + die( 'confirmdeletecomment' == $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.') ); echo "
\n"; if ( 'spam' == $_GET['delete_type'] ) echo "

" . __('Caution: You are about to mark the following comment as spam:') . "

\n"; - else + elseif ( 'confirmdeletecomment' == $action ) echo "

" . __('Caution: You are about to delete the following comment:') . "

\n"; + else + echo "

" . __('Caution: You are about to approve the following comment:') . "

\n"; echo "\n"; echo "\n"; echo "\n"; @@ -67,7 +71,7 @@ case 'confirmdeletecomment': echo "

" . __('Are you sure you want to do that?') . "

\n"; echo "\n"; - echo "\n"; + echo "\n"; if ( 'spam' == $_GET['delete_type'] ) echo "\n"; echo "\n"; @@ -142,26 +146,6 @@ case 'unapprovecomment': exit(); break; -case 'mailapprovecomment': - - $comment = (int) $_GET['comment']; - - if ( ! $comment = get_comment($comment) ) - die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); - - if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); - - if ('1' != $comment->comment_approved) { - wp_set_comment_status($comment->comment_ID, 'approve'); - if (true == get_option('comments_notify')) - wp_notify_postauthor($comment->comment_ID); - } - - header('Location: ' . get_option('siteurl') . '/wp-admin/moderation.php?approved=1'); - exit(); - break; - case 'approvecomment': check_admin_referer(); diff --git a/wp-admin/edit.php b/wp-admin/edit.php index fcf268d39..19a66fcf9 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -249,7 +249,7 @@ if ( 1 == count($posts) ) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); if ($comments) { ?> -

+

    ', '>', $text); if ( 'double' === $quotes ) {
" . __('Author:') . "$comment->comment_author
" . __('E-mail:') . "$comment->comment_author_email