Make WordPress Core

Opened 7 years ago

Last modified 5 years ago

#38956 new enhancement

Customize Menus: menus assigned to locations with limited depths should not allow deeper depths

Reported by: celloexpressions's profile celloexpressions Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.3
Component: Customize Keywords: needs-patch
Focuses: Cc:

Description

wp_nav_menu() allows themes to control how many levels of depth will be displayed in the menu hierarchy. However, the menus UI doesn't reflect this or explain why submenu items may not always be visible. There are often valid situations where menus can only accept one level of hierarchy (such as social menus), and the API allows this on the theme side but doesn't address the usability side of the issue.

This may be tricky because depth is defined here a menu is displayed, not where a location is registered. Menus can also be assigned to multiple locations. A better API for menu locations may facilitate this improvement.

Change History (2)

#1 @westonruter
7 years ago

This is a good one. If a theme doesn't have styling to support tertiary-level submenus, then they shouldn't be allowed. Basically I think this will need to be a param added register_nav_menu(), and when a menu is assigned to that location it will need to prevent nesting deeper than the location to which the menu is assigned. It gets tricky however in the case where the same menu may be assigned to multiple nav menus which may have conflicting depths mandated.

#2 @celloexpressions
5 years ago

For menus assigned to multiple locations, the lowest (most-restrictive) allowed depth based on all locations should be enforced in the menus UI.

Note: See TracTickets for help on using tickets.