Retrieves HTML list content for category list.
Description
See also
- Walker::walk(): for parameters and return description.
Parameters
$args
mixedrequired- Elements array, maximum hierarchical depth and optional additional arguments.
Source
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 );
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.