Make WordPress Core

Changeset 6048


Ignore:
Timestamp:
09/06/2007 04:34:06 AM (17 years ago)
Author:
ryan
Message:

Resurrect hide_empty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r6026 r6048  
    515515    if ( $pad_counts )
    516516        _pad_category_counts($type, $categories);
     517    */
    517518
    518519    // Make sure we show empty categories that have children.
    519520    if ( $hierarchical && $hide_empty ) {
    520         foreach ( $categories as $k => $category ) {
    521             if ( ! $category->{'link' == $type ? 'link_count' : 'category_count'} ) {
    522                 $children = _get_cat_children($category->cat_ID, $categories);
     521        foreach ( $terms as $k => $term ) {
     522            if ( ! $term->count ) {
     523                $children = _get_term_children($term->term_id, $terms, $taxonomies[0]);
    523524                foreach ( $children as $child )
    524                     if ( $child->{'link' == $type ? 'link_count' : 'category_count'} )
     525                    if ( $child->count )
    525526                        continue 2;
    526527
    527528                // It really is empty
    528                 unset($categories[$k]);
     529                unset($terms[$k]);
    529530            }
    530531        }
    531532    }
    532     reset ( $categories );
    533     */
     533    reset ( $terms );
    534534
    535535    $cache[ $key ] = $terms;
Note: See TracChangeset for help on using the changeset viewer.