Index: /branches/2.6/wp-admin/edit-link-categories.php
===================================================================
--- /branches/2.6/wp-admin/edit-link-categories.php (revision 8388)
+++ /branches/2.6/wp-admin/edit-link-categories.php (revision 8389)
@@ -11,10 +11,11 @@
foreach( (array) $_GET['delete'] as $cat_ID ) {
$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’t delete the %s 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));
}
Index: /branches/2.6/wp-admin/link-category.php
===================================================================
--- /branches/2.6/wp-admin/link-category.php (revision 8388)
+++ /branches/2.6/wp-admin/link-category.php (revision 8389)
@@ -29,10 +29,11 @@
$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’t delete the %s 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';