- break;
-
-case 'unapprovecomment' :
- $comment_id = absint( $_GET['c'] );
- check_admin_referer( 'unapprove-comment_' . $comment_id );
-
- if ( isset( $_GET['noredir'] ) )
- $noredir = true;
- else
- $noredir = false;
-
- if ( !$comment = get_comment( $comment_id ) )
- comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
-
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
-
- wp_set_comment_status( $comment->comment_ID, 'hold' );
-
- if ( '' != wp_get_referer() && false == $noredir )
- wp_redirect( wp_get_referer() );
- else
- wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
-
- exit();
- break;
-
-case 'approvecomment' :
- $comment_id = absint( $_GET['c'] );
- check_admin_referer( 'approve-comment_' . $comment_id );
-
- if ( isset( $_GET['noredir'] ) )
- $noredir = true;
- else
- $noredir = false;
-
- if ( !$comment = get_comment( $comment_id ) )
- comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
-
- if ( !current_user_can('edit_post', $comment->comment_post_ID) )
- comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
-
- wp_set_comment_status( $comment->comment_ID, 'approve' );
-
- if ( '' != wp_get_referer() && false == $noredir )
- wp_redirect( wp_get_referer() );
- else
- wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
-
- exit();
- break;