diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 8f3afa4d2a..dcc0039052 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -59,7 +59,7 @@ case 'Delete': $standalone = 1; require_once('b2header.php'); - $cat_ID = intval($HTTP_POST_VARS["cat_ID"]); + $cat_ID = intval($HTTP_GET_VARS["cat_ID"]); $cat_name = get_catname($cat_ID); $cat_name = addslashes($cat_name); @@ -76,22 +76,23 @@ case 'Delete': break; -case 'Rename': +case 'edit': require_once ('b2header.php'); - $cat_name = get_catname($HTTP_POST_VARS['cat_ID']); - $cat_name = stripslashes($cat_name); + $category = $wpdb->get_row("SELECT * FROM $tablecategories WHERE cat_ID = " . $HTTP_GET_VARS['cat_ID']); + $cat_name = stripslashes($category->cat_name); ?>
-

Old name:

-

-

- New name:
+

Edit Category

+ - -
- + +

Category name:
+

+

Description:
+

+

@@ -110,8 +111,9 @@ case 'editedcat': $cat_name = addslashes(stripslashes(stripslashes($HTTP_POST_VARS['cat_name']))); $cat_ID = addslashes($HTTP_POST_VARS['cat_ID']); $category_nicename = sanitize_title($cat_name); + $category_description = $HTTP_POST_VARS['category_description']; - $wpdb->query("UPDATE $tablecategories SET cat_name = '$cat_name', category_nicename = '$category_nicename' WHERE cat_ID = $cat_ID"); + $wpdb->query("UPDATE $tablecategories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description' WHERE cat_ID = $cat_ID"); header('Location: categories.php'); @@ -127,35 +129,43 @@ default: ?>
-
-

-

+

Current Categories

+ + + + + + + + get_results("SELECT * FROM $tablecategories ORDER BY cat_ID"); - echo " + + + + "; } - echo "\n"; - ?>

-

- -

- - - + ?> +
Category NameDescription# PostsEditDelete
$category->cat_name$category->category_description$countEditcat_name\' and all its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop.')\">Delete
+ +
+
+

Add New Category

-

- + +

Category name:
+

+

Description:
+

+

-

Note:
Deleting a category does not delete posts from that category, it will just