Opened 15 years ago
Closed 15 years ago
#12844 closed enhancement (fixed)
Merge wp_get_nav_menu() with wp_nav_menu() and improve arguments passed
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | low |
Severity: | minor | Version: | 3.0 |
Component: | Menus | Keywords: | wp_get_nav_menu, id has-patch |
Focuses: | Cc: |
Description
It's currently not possible to get an id on the ul element returned by wp_get_nav_menu (only class), if I want an id I'd have to use wp_nav_menu, but that wraps the ul in a div. This is unnecessary markup.
This can be fixed by adding an menu_id argument, just like there's an menu_class argument.
Attachments (1)
Change History (6)
#3
@
15 years ago
- Milestone changed from Unassigned to 3.0
I spoke with ptahdunbar and we're going to probably combine wp_get_nav_menu() and wp_nav_menu(). The latter does allow you to omit the div, and it then passes its arguments to wp_get_nav_menu(), which then spits out the ul with classes.
I see it as working like this: optional container element (not just div, as many will want to use the new HTML5 nav element), along with an optional ID. The id is applied to the container, or if no container, then the id is applied to the ul. We'll probably need separate container and ul classes though.
We also need to make sure we're properly escaping attributes.
Patch adds menu_id argument to wp_get_nav_menu