WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 9 months ago

#38956 new enhancement

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

Reported by: 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 (1)

#1 @westonruter
9 months 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.

Note: See TracTickets for help on using tickets.