From bc386e1784562370d2282b6fec958b68800d08a2 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 7 Dec 2006 22:38:27 +0000 Subject: [PATCH] Check link_count not category_count when doing link hierarchy. Props mdawaffe. fixes #3453 git-svn-id: https://develop.svn.wordpress.org/trunk@4627 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 5bcfbcb519..edfc0f5407 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -111,15 +111,15 @@ function &get_categories($args = '') { // Update category counts to include children. if ( $hierarchical ) { foreach ( $categories as $k => $category ) { - $progeny = $category->category_count; + $progeny = 'link' == $type ? $category->link_count : $category->category_count; if ( $children = _get_cat_children($category->cat_ID, $categories) ) { foreach ( $children as $child ) - $progeny += $child->category_count; + $progeny += 'link' == $type ? $child->link_count : $child->category_count; } if ( !$progeny && $hide_empty ) unset($categories[$k]); else - $categories[$k]->category_count = $progeny; + $categories[$k]->{'link' == $type ? 'link_count' : 'category_count'} = $progeny; } } reset ( $categories );