WordPress.org

Make WordPress Core

Ticket #16863: 16863.patch

File 16863.patch, 778 bytes (added by SergeyBiryukov, 3 years ago)

Actual patch

  • wp-includes/taxonomy.php

     
    13851385 
    13861386        // Make sure we show empty categories that have children. 
    13871387        if ( $hierarchical && $hide_empty && is_array($terms) ) { 
     1388                $tax_terms = !empty($include) || !empty($exclude) || !empty($exclude_tree) ? get_terms($taxonomies) : $terms; 
     1389 
    13881390                foreach ( $terms as $k => $term ) { 
    13891391                        if ( ! $term->count ) { 
    1390                                 $children = _get_term_children($term->term_id, $terms, $taxonomies[0]); 
     1392                                $children = _get_term_children($term->term_id, $tax_terms, $taxonomies[0]); 
    13911393                                if ( is_array($children) ) 
    13921394                                        foreach ( $children as $child ) 
    13931395                                                if ( $child->count )