#13656 closed enhancement (fixed)
Allow multiple "contexts" for wp_nav_menu()
Reported by: | nathanrice | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | has-patch |
Focuses: | Cc: |
Description
It occurred to me that 'frontend' or 'backend' as a context for the nav menus is only partially complete. For instance, I may want to specify that not only is this menu is displaying on the frontend, but that it's in the header, or footer, or sidebar, etc.
I think it's just more accurate that way. Patch submitted.
Attachments (1)
Change History (12)
#2
@
14 years ago
- Milestone 3.0 deleted
- Resolution set to worksforme
- Status changed from new to closed
#3
@
14 years ago
To elaborate on what nacin said, basically context acts as a private property just meant to say basically "don't use a fallback function" and "don't try to determine the current query context for class names" when the context is "backend."
Perhaps that could be better indicated with a name change or comments.
#4
@
14 years ago
Perhaps that could be better indicated with a name change or comments.
Agreed. Thoughts? 'backend' = true, defaults to false?
#6
@
14 years ago
- Milestone set to 3.0
- Resolution worksforme deleted
- Status changed from closed to reopened
#8
@
14 years ago
OK, so "context" is only a means of indicating if the menu is being displayed on the front or back end? It does seem like it's misnamed. I like nacin's idea of renaming it as a true/false flag.
#9
follow-up:
↓ 11
@
14 years ago
actually, as of r15075 context is gone.
When menus first went in wp_nav_menu
was printing the menu edit page, but it no longer does it, so context
is not needed.
#10
@
14 years ago
Also, for what it's worth, theme_location was inspired by the menu assignment limitations that were painfully obvious when taking a look at what you guys came up with over at StudioPress.
#11
in reply to:
↑ 9
@
14 years ago
Replying to filosofo:
actually, as of r15075 context is gone.
When menus first went in
wp_nav_menu
was printing the menu edit page, but it no longer does it, socontext
is not needed.
Ahh, good to know.
Replying to nacin:
Also, for what it's worth, theme_location was inspired by the menu assignment limitations that were painfully obvious when taking a look at what you guys came up with over at StudioPress.
Interesting :-) Good to know our pain can help make WordPress better. Hopefully, we can continue to provide good feedback to you guys from a themer's perspective, and help make the software better for everybody.
The 'context' in _wp_menu_item_classes_by_context is not the same as the 'context' that is the argument to wp_nav_menu. That's really just an internal argument we use, as wp_nav_menu() is also used in the admin.
What you're probably looking for is theme_location. [14620], #13378.