Resurrect hide_empty

git-svn-id: http://svn.automattic.com/wordpress/trunk@6048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-09-06 04:34:06 +00:00
parent 94973a275b
commit a428494291
1 changed files with 7 additions and 7 deletions

View File

@ -514,23 +514,23 @@ function &get_terms($taxonomies, $args = '') {
// Update category counts to include children.
if ( $pad_counts )
_pad_category_counts($type, $categories);
*/
// Make sure we show empty categories that have children.
if ( $hierarchical && $hide_empty ) {
foreach ( $categories as $k => $category ) {
if ( ! $category->{'link' == $type ? 'link_count' : 'category_count'} ) {
$children = _get_cat_children($category->cat_ID, $categories);
foreach ( $terms as $k => $term ) {
if ( ! $term->count ) {
$children = _get_term_children($term->term_id, $terms, $taxonomies[0]);
foreach ( $children as $child )
if ( $child->{'link' == $type ? 'link_count' : 'category_count'} )
if ( $child->count )
continue 2;
// It really is empty
unset($categories[$k]);
unset($terms[$k]);
}
}
}
reset ( $categories );
*/
reset ( $terms );
$cache[ $key ] = $terms;
wp_cache_set( 'get_terms', $cache, 'term' );