From 083dfb059b0ca8e6511021a8b0510cf8da7b192c Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 29 May 2007 21:50:00 +0000 Subject: [PATCH] Fix listing of categories with parents. see #4189 git-svn-id: http://svn.automattic.com/wordpress/trunk@5594 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 3ddcfd3fb..1a5aaafde 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -5,7 +5,6 @@ $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'); $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); -//error_log(var_export($wp_taxonomies, true), 0); function is_taxonomy( $taxonomy ) { global $wp_taxonomies; @@ -714,11 +713,20 @@ function &_get_term_children($term_id, $terms, $taxonomy) { return array(); foreach ( $terms as $term ) { + $use_id = false; + if ( !is_object($term) ) { + $term = get_term($term, $taxonomy); + $use_id = true; + } + if ( $term->term_id == $term_id ) continue; if ( $term->parent == $term_id ) { - $term_list[] = $term; + if ( $use_id ) + $term_list[] = $term->term_id; + else + $term_list[] = $term; if ( !isset($has_children[$term->term_id]) ) continue;