walk_nav_menu_tree()WP 3.0.0

Retrieves the HTML list content for nav menu items.

No Hooks.

Return

String. The HTML list content for the menu items.

Usage

walk_nav_menu_tree( $items, $depth, $args );
$items(array) (required)
The menu items, sorted by each menu item's menu order.
$depth(int) (required)
Depth of the item in reference to parents.
$args(stdClass) (required)
An object containing wp_nav_menu() arguments.

Changelog

Since 3.0.0 Introduced.

Code of walk_nav_menu_tree() WP 6.0

function walk_nav_menu_tree( $items, $depth, $args ) {
	$walker = ( empty( $args->walker ) ) ? new Walker_Nav_Menu : $args->walker;

	return $walker->walk( $items, $depth, $args );
}