diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 5601b0566f..6cd9707039 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 ) - + + +