On this page
walk_category_tree( mixed $args ): string
Retrieves HTML list content for category list.
Description
See also
- Walker::walk(): for parameters and return description.
Parameters
$argsmixed Required-
Elements array, maximum hierarchical depth and optional additional arguments.
Return
string
Source
File: wp-includes/category-template.php. View all references
function walk_category_tree( ...$args ) {
// The user's options are the third parameter.
if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
$walker = new Walker_Category;
} else {
/**
* @var Walker $walker
*/
$walker = $args[2]['walker'];
}
return $walker->walk( ...$args );
}
Related
Uses
| Uses | Description |
|---|---|
| Walker::walk() wp-includes/class-wp-walker.php | Displays array of elements hierarchically. |
Used By
| Used By | Description |
|---|---|
| wp_list_categories() wp-includes/category-template.php | Displays or retrieves the HTML list of categories. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/walk_category_tree