New function which combines primary/secondary nav menus into one
|Reported by:||DJPaul||Owned by:|
|Component:||Component - Core||Keywords:|
Patch implements a proposed merged nav menu function. Written for the turtleshell template pack.
BP currently renders its menus via bp_get_displayed_user_nav() and bp_get_options_nav(). It's been an annoying quirk that we've ended up with these two get_ functions which print the output rather than return it. Historically, these menus have always been visually separate in the Default theme; either vertically before 1.2, and horizontally nested since 1.2. Something that's been asked from the community is a way to produce a merged menu
This can't be done today without plugins/themes touching the $bp object. A merged menu would allow e.g. easy implementation of a multi-level, expand-on-mouseover menu -- just like the main navigation of a lot of WordPress themes.
The attached patch implements this proposed feature, and introduces a custom Walker class and bp_nav_menu(). The arguments for bp_nav_menu are identical to wp_nav_menu(), providing maximum customisation and familiarity for WordPress theme authors, and should give us reasonable future compatibility (bp_nav_menu() could become a wrapper).
Change History (16)
- Keywords 2nd-opinion needs-testing added
- Resolution fixed deleted
- Status changed from closed to reopened