summaryrefslogtreecommitdiffstats
path: root/wp-includes/category.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
commite30516b2ee40c1c45c8f288c20a3d4372e478624 (patch)
treebd6b8bcc4c06697f50e6985a6b08620e25bc572e /wp-includes/category.php
parente20c9aa016d6885c6e3fc7425525b4090f05ac2a (diff)
downloadwordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.gz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.xz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.zip
WP Merge to #4124
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@734 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/category.php')
-rw-r--r--wp-includes/category.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/wp-includes/category.php b/wp-includes/category.php
index 648ef4f..6ffb210 100644
--- a/wp-includes/category.php
+++ b/wp-includes/category.php
@@ -172,7 +172,7 @@ function get_category_by_path($category_path, $full_match = true, $output = OBJE
foreach ($categories as $category) {
$path = '/' . $leaf_path;
$curcategory = $category;
- while ($curcategory->category_parent != 0) {
+ while ( ($curcategory->category_parent != 0) && ($curcategory->category_parent != $curcategory->cat_ID) ) {
$curcategory = $wpdb->get_row("SELECT cat_ID, category_nicename, category_parent FROM $wpdb->categories WHERE cat_ID = '$curcategory->category_parent'");
$path = '/' . $curcategory->category_nicename . $path;
}
@@ -219,6 +219,9 @@ function &_get_cat_children($category_id, $categories) {
$category_list = array();
foreach ( $categories as $category ) {
+ if ( $category->cat_ID == $category_id )
+ continue;
+
if ( $category->category_parent == $category_id ) {
$category_list[] = $category;
if ( $children = _get_cat_children($category->cat_ID, $categories) )