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

git-svn-id: https://develop.svn.wordpress.org/trunk@9294 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-23 00:08:42 +00:00
parent 2294054fad
commit c9fe5996e2
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>