Skip to content

Commit

Permalink
Check link_count not category_count when doing link hierarchy. Props …
Browse files Browse the repository at this point in the history
…mdawaffe. fixes #3453

git-svn-id: http://svn.automattic.com/wordpress/trunk@4627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Dec 7, 2006
1 parent 0aa1952 commit 60fdec5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wp-includes/category.php
Expand Up @@ -111,15 +111,15 @@ function stamp_cat($cat) {
// 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 );
Expand Down

0 comments on commit 60fdec5

Please sign in to comment.