From b6d7b43d2d35248ee682a48e00009add724e2f68 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 1 Apr 2006 23:27:47 +0000 Subject: [PATCH] Add braces in case our belt gives out after a large meal. Props westi. fixes #2609 git-svn-id: https://develop.svn.wordpress.org/trunk@3675 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/categories.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 9f444faca2..7c46005caf 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -44,9 +44,13 @@ case 'delete': $cat_ID = (int) $_GET['cat_ID']; $cat_name = get_catname($cat_ID); - if ( 1 == $cat_ID ) + // Don't delete the default cats. + if ( $cat_ID == get_option('default_category') ) die(sprintf(__("Can't delete the %s category: this is the default one"), $cat_name)); + if ( $cat_ID == get_option('default_link_category') ) + die(sprintf(__("Can't delete the %s category: this is the default one for bookmarks"), $cat_name)); + wp_delete_category($cat_ID); header('Location: categories.php?message=2');