Make WordPress Core

Changeset 4627


Ignore:
Timestamp:
12/07/2006 10:38:27 PM (20 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.