From 8e0883da2ffd31137eefa1ee44441fc480a0ff12 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 23 Oct 2008 00:08:42 +0000 Subject: [PATCH] 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 --- wp-admin/categories.php | 12 ++++++++++-- wp-admin/edit-category-form.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 0386f24e8f..eefb376869 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -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; diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index 62888efddb..d2b58a74b1 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -61,7 +61,7 @@ _fill_empty_category($category); - +