[ Index ]

PHP Cross Reference of BuddyPress




/src/bp-core/classes/ -> class-bp-walker-nav-menu.php (summary)

Core component classes.

File Size: 220 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Walker_Nav_Menu_Compat:: (2 methods):

Class: BP_Walker_Nav_Menu_Compat  - X-Ref

Compatibility Class to make BP_Walker_Nav_Menu::walk() compatible
from PHP 5.3 to 5.6 and up.

do_walk( $elements, $max_depth, $args = array()   X-Ref
Display array of elements hierarchically.

This method is almost identical to the version in {@link 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.

return: string See {@link Walker::walk()}.
since: 1.7.0
since: 5.1.0 Method was renamed from `walk` to `do_walk` to ensure PHP 5.3 compatibility
param: array $elements  See {@link Walker::walk()}.
param: int   $max_depth See {@link Walker::walk()}.
param: array $args      Optional additional arguments.

start_el( &$output, $item, $depth = 0, $args = array()   X-Ref
Display the current <li> that we are on.

since: 1.7.0
param: string $output Passed by reference. Used to append
param: object $item   Menu item data object.
param: int    $depth  Depth of menu item. Used for padding. Optional,
param: array  $args   Optional. See {@link Walker::start_el()}.
param: int    $id     Menu item ID. Optional.

Generated: Sat Feb 22 01:01:35 2020 Cross-referenced by PHPXref 0.7.1