walk_nav_menu_tree

The timeline below displays how wordpress function walk_nav_menu_tree has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 *
 * @param array    $items The menu items, sorted by each menu item's menu order.
 * @param int      $depth Depth of the item in reference to parents.
 * @param stdClass $args  An object containing wp_nav_menu() arguments.
 * @return string The HTML list content for the menu items.
 */
function walk_nav_menu_tree($items, $depth, $args)
{
    $walker = empty($args->walker) ? new Walker_Nav_Menu() : $args->walker;
    return $walker->walk($items, $depth, $args);
}

WordPress Version: 5.5

/**
 * Retrieves the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 *
 * @param array    $items The menu items, sorted by each menu item's menu order.
 * @param int      $depth Depth of the item in reference to parents.
 * @param stdClass $r     An object containing wp_nav_menu() arguments.
 * @return string The HTML list content for the menu items.
 */
function walk_nav_menu_tree($items, $depth, $r)
{
    $walker = empty($r->walker) ? new Walker_Nav_Menu() : $r->walker;
    return $walker->walk($items, $depth, $r);
}

WordPress Version: 5.3

/**
 * Retrieve the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 *
 * @param array    $items The menu items, sorted by each menu item's menu order.
 * @param int      $depth Depth of the item in reference to parents.
 * @param stdClass $r     An object containing wp_nav_menu() arguments.
 * @return string The HTML list content for the menu items.
 */
function walk_nav_menu_tree($items, $depth, $r)
{
    $walker = empty($r->walker) ? new Walker_Nav_Menu() : $r->walker;
    return $walker->walk($items, $depth, $r);
}

WordPress Version: 4.7

/**
 * Retrieve the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 *
 * @param array    $items The menu items, sorted by each menu item's menu order.
 * @param int      $depth Depth of the item in reference to parents.
 * @param stdClass $r     An object containing wp_nav_menu() arguments.
 * @return string The HTML list content for the menu items.
 */
function walk_nav_menu_tree($items, $depth, $r)
{
    $walker = empty($r->walker) ? new Walker_Nav_Menu() : $r->walker;
    $args = array($items, $depth, $r);
    return call_user_func_array(array($walker, 'walk'), $args);
}

WordPress Version: 4.3

/**
 * Retrieve the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 *
 * @param array  $items
 * @param int    $depth
 * @param object $r
 * @return string
 */
function walk_nav_menu_tree($items, $depth, $r)
{
    $walker = empty($r->walker) ? new Walker_Nav_Menu() : $r->walker;
    $args = array($items, $depth, $r);
    return call_user_func_array(array($walker, 'walk'), $args);
}

WordPress Version: 3.7

/**
 * Retrieve the HTML list content for nav menu items.
 *
 * @uses Walker_Nav_Menu to create HTML list content.
 * @since 3.0.0
 * @see Walker::walk() for parameters and return description.
 */
function walk_nav_menu_tree($items, $depth, $r)
{
    $walker = empty($r->walker) ? new Walker_Nav_Menu() : $r->walker;
    $args = array($items, $depth, $r);
    return call_user_func_array(array($walker, 'walk'), $args);
}