From 8d1cfdb4348e055a66c2366a7cee2bea7c68820e Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 14 Nov 2005 10:11:15 +0000 Subject: [PATCH] These are not the categories you're looking for, fixes #1654 git-svn-id: http://svn.automattic.com/wordpress/trunk@3079 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 48e6855411..42afd1270e 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -512,8 +512,15 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { $category->cat_name = wp_specialchars($category->cat_name); $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID"); $pad = str_repeat('— ', $level); - if (current_user_can('manage_categories')) - $edit = "".__('Edit')."cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts will go to the default category.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete').""; + if ( current_user_can('manage_categories') ) { + $edit = "".__('Edit').""; + $default_cat_id = get_option('default_category'); + + if ($category->cat_ID != $default_cat_id) + $edit .= "cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts will go to the default category.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete').""; + else + $edit .= "".__("Default"); + } else $edit = '';