BP_Walker_Nav_Menu::do_walk( array $elements, int $max_depth, array $args = array() )
Display array of elements hierarchically.
Description Description
This method is almost identical to the version in Walker::walk(). The only change is on one line which has been commented. An IF was comparing 0 to a non-empty string which was preventing child elements being grouped under their parent menu element.
This caused a problem for BuddyPress because our primary/secondary navigations don’t have a unique numerical ID that describes a hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and those have ID/post_parent.
See also See also
Parameters Parameters
- $elements
-
(Required) See Walker::walk().
- $max_depth
-
(Required) See Walker::walk().
- $args
-
(Optional) additional arguments.
Default value: array()
Return Return
(string) See Walker::walk().
Source Source
File: bp-core/classes/class-bp-walker-nav-menu.php
Changelog Changelog
Version | Description |
---|---|
5.1.0 | Method was renamed from walk to do_walk to ensure PHP 5.3 compatibility |
1.7.0 | Introduced. |