summaryrefslogtreecommitdiffstats
path: root/wp-admin/link-category.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-08-13 15:13:05 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-08-13 15:13:05 +0000
commitbfa3b629e0d67016ec83050c5db762479af40609 (patch)
tree4c9ae204172d0fad3ae056ccc65ffe9ea91134d2 /wp-admin/link-category.php
parent7258ea2d7eeedb439607b72a1f74dee98e4b9d12 (diff)
downloadwordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.tar.gz
wordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.tar.xz
wordpress-mu-bfa3b629e0d67016ec83050c5db762479af40609.zip
Merge with WP revision 8635
git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1421 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/link-category.php')
-rw-r--r--wp-admin/link-category.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/wp-admin/link-category.php b/wp-admin/link-category.php
index a67cf2b..ea64791 100644
--- a/wp-admin/link-category.php
+++ b/wp-admin/link-category.php
@@ -28,12 +28,13 @@ case 'delete':
wp_die(__('Cheatin&#8217; uh?'));
$cat_name = get_term_field('name', $cat_ID, 'link_category');
+ $default_cat_id = get_option('default_link_category');
// Don't delete the default cats.
- if ( $cat_ID == get_option('default_link_category') )
+ if ( $cat_ID == $default_cat_id )
wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
- wp_delete_term($cat_ID, 'link_category');
+ wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
$location = 'edit-link-categories.php';
if ( $referer = wp_get_original_referer() ) {
@@ -73,7 +74,9 @@ case 'editedcat':
$location = $referer;
}
- if ( wp_update_term($cat_ID, 'link_category', $_POST) )
+ $update = wp_update_term($cat_ID, 'link_category', $_POST);
+
+ if ( $update && !is_wp_error($update) )
$location = add_query_arg('message', 3, $location);
else
$location = add_query_arg('message', 5, $location);