From afd8045b5f57aae2dc254f07121bcd552415ff3c Mon Sep 17 00:00:00 2001
From: Matt Mullenweg
Date: Tue, 27 Jan 2004 08:31:17 +0000
Subject: [PATCH] Sub-categories interface improvements.
git-svn-id: https://develop.svn.wordpress.org/trunk@799 602fd350-edb4-49c9-b593-d223f7449a82
---
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 94335c50bd..88cf809756 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 8fc56c62c6..cc94400579 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 ec09ba6531..b38dd682f2 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){