From 489f3e78cc4465c454c3201b5afa941bdd4552d7 Mon Sep 17 00:00:00 2001 From: azaozz Date: Mon, 8 Sep 2008 21:49:26 +0000 Subject: [PATCH] Adds "Delete all spam" button when viewing spam in comment management git-svn-id: http://svn.automattic.com/wordpress/trunk@8851 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-comments.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 5601b0566..6cd970703 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -14,6 +14,13 @@ wp_enqueue_script( 'admin-comments' ); wp_enqueue_script( 'admin-forms' ); wp_enqueue_script( 'jquery-table-hotkeys' ); +if ( isset( $_POST['delete_all_spam'] ) ) { + check_admin_referer('bulk-spam-delete'); + + $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam'" ); + wp_redirect('edit-comments.php?deleted=' . (int) $deleted_spam); +} + if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) { check_admin_referer('bulk-comments'); @@ -61,6 +68,7 @@ $comment_status = isset($_GET['comment_status']) ? attribute_escape($_GET['comme $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; $search = attribute_escape( $search_dirty ); ?> + $label ) { if ( $status == $comment_status ) $class = ' class="current"'; - $status_links[] = "
  • $label"; } @@ -186,11 +193,16 @@ if ( $page_links ) - + + +