From 292737d0b29afe37180e062508a1f00cd9682675 Mon Sep 17 00:00:00 2001
From: saxmatt
Date: Tue, 27 Jan 2004 08:31:17 +0000
Subject: [PATCH] Sub-categories interface improvements.
git-svn-id: http://svn.automattic.com/wordpress/trunk@799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/admin-header.php | 1 +
wp-admin/categories.php | 44 ++++++++++++------------------
wp-includes/template-functions.php | 2 +-
3 files changed, 20 insertions(+), 27 deletions(-)
diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 94335c50b..88cf80975 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -2,6 +2,7 @@
require_once('../wp-config.php');
require_once(ABSPATH.'/wp-admin/auth.php');
+require(ABSPATH.'/wp-admin/admin-functions.php');
function gethelp_link($this_file, $helptag) {
$url = 'http://wordpress.org/docs/reference/links/#'.$helptag;
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index 8fc56c62c..cc9440057 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -92,7 +92,10 @@ case 'edit':
Category name:
Category parent:
- category_parent, $HTTP_GET_VARS['cat_ID']); ?>
+
+ cat_ID, $category->category_parent); ?>
+
+
Description:
@@ -132,30 +135,17 @@ default:
?>
-
Current Categories
-
-
- Name
- Parent
- Description
- # Posts
- Action
-
- get_results("SELECT * FROM $tablecategories ORDER BY cat_name");
- foreach ($categories as $category) {
- $parent = "None";
- if ($category->category_parent) $parent = $wpdb->get_var("SELECT cat_name FROM $tablecategories WHERE cat_ID = $category->category_parent");
- $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $tablepost2cat WHERE category_id = $category->cat_ID");
- $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
- echo "$category->cat_name
- $parent
- $category->category_description
- $count
- Edit cat_name) ."\' and all its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop.')\" class='delete'>Delete
- ";
- }
- ?>
+Current Categories
+
+
+ Name
+ Description
+ # Posts
+ Action
+
+
@@ -166,7 +156,9 @@ default:
Name:
Category parent:
-
+
+
+
Description: (optional)
diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php
index ec09ba653..b38dd682f 100644
--- a/wp-includes/template-functions.php
+++ b/wp-includes/template-functions.php
@@ -1460,7 +1460,7 @@ function get_category_parents($id, $link=FALSE, $separator=' / ', $nicename=FALS
function get_category_children($id, $before=' / ', $after='') {
global $tablecategories, $cache_categories;
- $c_cache=$cache_categories;#can't do recursive foreach on a global, have to make a copy
+ $c_cache=$cache_categories; // Can't do recursive foreach on a global, have to make a copy
$chain = "";
foreach ($c_cache as $category){
if ($category->category_parent == $id){