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


Top ↑

Parameters Parameters

$elements

(Required) See Walker::walk().

$max_depth

(Required) See Walker::walk().

$args

(Optional) additional arguments.

Default value: array()


Top ↑

Return Return

(string) See Walker::walk().


Top ↑

Source Source

File: bp-core/classes/class-bp-walker-nav-menu.php


			

Top ↑

Changelog 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.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.