diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 7218be8e49..3bac0582e1 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -134,7 +134,7 @@ case 'add-link-category' : // On the Fly $cat_name = trim($cat_name); if ( !$slug = sanitize_title($cat_name) ) die('0'); - if ( !$cat_id = category_exists( $cat_name ) ) { + if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) { $cat_id = wp_insert_term( $cat_name, 'link_category' ); $cat_id = $cat_id['term_id']; } diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 41caea2255..6fc07889b0 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -36,9 +36,6 @@ case 'delete': if ( $cat_ID == get_option('default_category') ) wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); - if ( $cat_ID == get_option('default_link_category') ) - wp_die(sprintf(__("Can’t delete the %s category: this is the default one for links"), $cat_name)); - wp_delete_category($cat_ID); wp_redirect('categories.php?message=2'); @@ -113,7 +110,7 @@ cat_rows();
Note:
Deleting a category does not delete the posts and links in that category. Instead, posts that were only assigned to the deleted category are set to the category %s and links that were only assigned to the deleted category are set to %s.'), apply_filters('the_category', get_catname(get_option('default_category'))), apply_filters('the_category', get_catname(get_option('default_link_category')))) ?>
Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>
+ | + | + | + | + |
---|
Note:
Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>