Make WordPress Core

Ticket #3453: 3453.diff

File 3453.diff, 943 bytes (added by mdawaffe, 19 years ago)
  • wp-includes/category.php

     
    111111        // Update category counts to include children.
    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        }
    125125        reset ( $categories );