summaryrefslogtreecommitdiffstats
path: root/wp-admin/link-category.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/link-category.php')
-rw-r--r--wp-admin/link-category.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/wp-admin/link-category.php b/wp-admin/link-category.php
index 4205892..a67cf2b 100644
--- a/wp-admin/link-category.php
+++ b/wp-admin/link-category.php
@@ -35,14 +35,22 @@ case 'delete':
wp_delete_term($cat_ID, 'link_category');
- wp_redirect('edit-link-categories.php?message=2');
+ $location = 'edit-link-categories.php';
+ if ( $referer = wp_get_original_referer() ) {
+ if ( false !== strpos($referer, 'edit-link-categories.php') )
+ $location = $referer;
+ }
+
+ $location = add_query_arg('message', 2, $location);
+
+ wp_redirect($location);
exit;
break;
case 'edit':
$title = __('Categories');
- $parent_file = 'link-manager.php';
+ $parent_file = 'edit.php';
$submenu_file = 'edit-link-categories.php';
require_once ('admin-header.php');
$cat_ID = (int) $_GET['cat_ID'];
@@ -59,11 +67,18 @@ case 'editedcat':
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin’ uh?'));
+ $location = 'edit-link-categories.php';
+ if ( $referer = wp_get_original_referer() ) {
+ if ( false !== strpos($referer, 'edit-link-categories.php') )
+ $location = $referer;
+ }
+
if ( wp_update_term($cat_ID, 'link_category', $_POST) )
- wp_redirect('edit-link-categories.php?message=3');
+ $location = add_query_arg('message', 3, $location);
else
- wp_redirect('edit-link-categories.php?message=5');
+ $location = add_query_arg('message', 5, $location);
+ wp_redirect($location);
exit;
break;
}