Remember pagenum when redirecting after saving a category. fixes #7923

git-svn-id: http://svn.automattic.com/wordpress/trunk@9294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-10-23 00:08:42 +00:00
parent fe5cd0fa48
commit 8e0883da2f
2 changed files with 11 additions and 3 deletions

View File

@ -94,10 +94,18 @@ case 'editedcat':
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin’ uh?'));
$location = 'categories.php';
if ( $referer = wp_get_original_referer() ) {
if ( false !== strpos($referer, 'categories.php') )
$location = $referer;
}
if ( wp_update_category($_POST) )
wp_redirect('categories.php?message=3');
$location = add_query_arg('message', 3, $location);
else
wp_redirect('categories.php?message=5');
$location = add_query_arg('message', 5, $location);
wp_redirect($location);
exit;
break;

View File

@ -61,7 +61,7 @@ _fill_empty_category($category);
<?php echo $form ?>
<input type="hidden" name="action" value="<?php echo $action ?>" />
<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
<?php wp_nonce_field($nonce_action); ?>
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>