Changeset 4627

Show
Ignore:
Timestamp:
12/07/06 22:38:27 (2 years ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/category.php

    r4528 r4627  
    112112    if ( $hierarchical ) { 
    113113        foreach ( $categories as $k => $category ) { 
    114             $progeny = $category->category_count; 
     114            $progeny = 'link' == $type ? $category->link_count : $category->category_count; 
    115115            if ( $children = _get_cat_children($category->cat_ID, $categories) ) { 
    116116                foreach ( $children as $child ) 
    117                     $progeny += $child->category_count; 
     117                    $progeny += 'link' == $type ? $child->link_count : $child->category_count; 
    118118            } 
    119119            if ( !$progeny && $hide_empty ) 
    120120                unset($categories[$k]); 
    121121            else 
    122                 $categories[$k]->category_count = $progeny; 
     122                $categories[$k]->{'link' == $type ? 'link_count' : 'category_count'} = $progeny; 
    123123        } 
    124124    }