walk_category_tree example

$current_term_object = get_queried_object();
            if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
                $parsed_args['current_category'] = get_queried_object_id();
            }
        }

        if ( $parsed_args['hierarchical'] ) {
            $depth = $parsed_args['depth'];
        } else {
            $depth = -1; // Flat.         }
        $output .= walk_category_tree( $categories$depth$parsed_args );
    }

    if ( $parsed_args['title_li'] && 'list' === $parsed_args['style']
        && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] )
    ) {
        $output .= '</ul></li>';
    }

    /** * Filters the HTML output of a taxonomy list. * * @since 2.1.0 * * @param string $output HTML output. * @param array|string $args An array or query string of taxonomy-listing arguments. See * wp_list_categories() for information on accepted arguments. */
Home | Imprint | This part of the site doesn't use cookies.