_pad_term_counts example

foreach ( $taxonomies as $_tax ) {
                $children = _get_term_hierarchy( $_tax );
                if ( ! empty( $children ) ) {
                    $term_objects = _get_term_children( $child_of$term_objects$_tax );
                }
            }
        }

        // Update term counts to include children.         if ( $args['pad_counts'] && 'all' === $_fields ) {
            foreach ( $taxonomies as $_tax ) {
                _pad_term_counts( $term_objects$_tax );
            }
        }

        // Make sure we show empty categories that have children.         if ( $hierarchical && $args['hide_empty'] && is_array( $term_objects ) ) {
            foreach ( $term_objects as $k => $term ) {
                if ( ! $term->count ) {
                    $children = get_term_children( $term->term_id, $term->taxonomy );

                    if ( is_array( $children ) ) {
                        foreach ( $children as $child_id ) {
                            
Home | Imprint | This part of the site doesn't use cookies.