Menus: add visual Indicator for menu items with children
|Reported by:||downstairsdev||Owned by:||helen|
It's helpful to have a visual indicator when a top level menu item contains a hidden drop down menu.
This patch adds a filter to wp_nav_menu_objects in order to add the class "has-children" to top level menu items that contain children. This allows us to style it with psuedo element, similar to how the menu-toggle is styled for smaller screens.
The filter I used was posted by @chipbennet on the WordPress Theme Reviewers List. The same functionality could also be achieved by a Custom Nav Walker (see http://wptheming.com/2013/03/drop-down-menu-indicator/), but Chip's solution seemed more straightforward.
Neither method works unless a menu has actually been set.
Change History (20)
- Component changed from General to Bundled Theme
- Version set to trunk
comment:3 in reply to: ↑ 1 lancewillett — 13 months ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.6
comment:5 lancewillett — 13 months ago
- Keywords has-patch removed
- Milestone changed from 3.6 to Future Release
- Summary changed from Twenty Thirteen: Visual Indicator for Drop Down Menus to Twenty Thirteen: add visual Indicator for menu items with children
comment:6 lancewillett — 8 months ago
- Component changed from Bundled Theme to Menus
- Milestone changed from Future Release to 3.7
- Summary changed from Twenty Thirteen: add visual Indicator for menu items with children to Menus: add visual Indicator for menu items with children
comment:13 helen — 7 months ago
- Owner set to helen
- Resolution set to fixed
- Status changed from new to closed