Changeset 4104
- Timestamp:
- 08/17/2006 04:46:16 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/category.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category.php
r4040 r4104 68 68 $where .= $exclusions; 69 69 70 if ( $hide_empty ) {70 if ( $hide_empty && !$hierarchical ) { 71 71 if ( 'link' == $type ) 72 72 $where .= ' AND link_count > 0'; … … 104 104 $categories = & _get_cat_children($child_of, $categories); 105 105 106 // Update category counts to include children. 107 if ( $hierarchical ) { 108 foreach ( $categories as $k => $category ) { 109 $progeny = $category->category_count; 110 if ( $children = _get_cat_children($category->cat_ID, $categories) ) { 111 foreach ( $children as $child ) 112 $progeny += $child->category_count; 113 } 114 if ( !$progeny && $hide_empty ) 115 unset($categories[$k]); 116 else 117 $categories[$k]->category_count = $progeny; 118 } 119 } 120 reset ( $categories ); 121 106 122 return apply_filters('get_categories', $categories, $r); 107 123 }
Note: See TracChangeset
for help on using the changeset viewer.