diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index cd676f0261..48d72b53fb 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -6,7 +6,7 @@ $parent_file = 'edit-comments.php'; wp_enqueue_script( 'admin-comments' ); wp_enqueue_script('admin-forms'); -if ( !empty( $_REQUEST['delete_comments'] ) ) : +if ( !empty( $_REQUEST['delete_comments'] ) ) { check_admin_referer('bulk-comments'); $comments_deleted = $comments_approved = $comments_spammed = 0; @@ -27,8 +27,18 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) : $comments_approved++; } endforeach; - wp_redirect( basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed ); -endif; + $redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed; + if ( !empty($_REQUEST['mode']) ) + $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to); + if ( !empty($_REQUEST['comment_status']) ) + $redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to); + if ( !empty($_REQUEST['s']) ) + $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to); + wp_redirect( $redirect_to ); +} elseif ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; +} require_once('admin-header.php'); @@ -36,6 +46,11 @@ if ( empty($_GET['mode']) ) $mode = 'detail'; else $mode = attribute_escape($_GET['mode']); + +if ( isset($_GET['comment_status']) ) + $comment_status = attribute_escape($_GET['comment_status']); +else + $comment_status = ''; ?>