[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core component classes.

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

Defines 1 class

BP_Walker_Nav_Menu:: (3 methods):
  do_walk()
  walk()
  start_el()


Class: BP_Walker_Nav_Menu  - X-Ref

Create HTML list of BP nav items.

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.

walk( $elements, $max_depth, ...$args )   X-Ref
Overrides Walker::walk() method.

since: 6.0.0 Formalized the existing `...$args` parameter by adding it
param: array $elements  See {@link Walker::walk()}.
param: int   $max_depth See {@link Walker::walk()}.
param: mixed ...$args   See {@link Walker::walk()}.

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: Wed Feb 5 01:01:01 2025 Cross-referenced by PHPXref 0.7.1