Changeset 7006

Show
Ignore:
Timestamp:
02/24/08 20:28:36 (9 months ago)
Author:
ryan
Message:

Remember filter settings. Redirect cleanups.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/edit-comments.php

    r7005 r7006  
    77wp_enqueue_script('admin-forms'); 
    88 
    9 if ( !empty( $_REQUEST['delete_comments'] ) ) : 
     9if ( !empty( $_REQUEST['delete_comments'] ) ) { 
    1010    check_admin_referer('bulk-comments'); 
    1111 
     
    2828        } 
    2929    endforeach; 
    30     wp_redirect( basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed ); 
    31 endif; 
     30    $redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed; 
     31    if ( !empty($_REQUEST['mode']) ) 
     32        $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to); 
     33    if ( !empty($_REQUEST['comment_status']) ) 
     34        $redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to); 
     35    if ( !empty($_REQUEST['s']) ) 
     36        $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to); 
     37    wp_redirect( $redirect_to ); 
     38} elseif ( !empty($_GET['_wp_http_referer']) ) { 
     39     wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); 
     40     exit;  
     41
    3242 
    3343require_once('admin-header.php'); 
     
    3747else 
    3848    $mode = attribute_escape($_GET['mode']); 
     49 
     50if ( isset($_GET['comment_status']) ) 
     51    $comment_status = attribute_escape($_GET['comment_status']); 
     52else 
     53    $comment_status = ''; 
    3954?> 
    4055 
     
    4560<ul class="subsubsub"> 
    4661<?php 
    47 if ( isset($_GET['comment_status']) ) 
    48     $comment_status = $_GET['comment_status']; 
    49 else 
    50     $comment_status = ''; 
    5162$status_links = array(); 
    5263$num_comments = wp_count_comments(); 
     
    102113 
    103114<input type="hidden" name="mode" value="<?php echo $mode; ?>" /> 
     115<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" /> 
    104116 
    105117<ul class="view-switch"> 
    106     <li <?php if ( 'detail' == $mode ) echo "class='current'" ?>><a href="?mode=detail"><?php _e('Detail View') ?></a></li> 
    107     <li <?php if ( 'list' == $mode ) echo "class='current'" ?>><a href="?mode=list"><?php _e('List View') ?></a></li> 
     118    <li <?php if ( 'detail' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'detail', $_SERVER['REQUEST_URI'])) ?>"><?php _e('Detail View') ?></a></li> 
     119    <li <?php if ( 'list' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><?php _e('List View') ?></a></li> 
    108120</ul> 
    109121