Check link_count not category_count when doing link hierarchy. Props mdawaffe. fixes #3453

git-svn-id: http://svn.automattic.com/wordpress/trunk@4627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-12-07 22:38:27 +00:00
parent 0aa19529f9
commit 60fdec501d

View File

@ -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 );