Opened 16 years ago
Closed 16 years ago
#13916 closed defect (bug) (wontfix)
$args not passed to wp_get_nav_menu_items in wp_nav_menu function
| Reported by: | DreadLox | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Menus | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Hello,
With the recent implementation of wp_get_nav_menu_items filter ([13858]) , arguments passed to wp_nav_menu are not passed to wp_get_nav_menu_items and thus it prevents from passing additional arguments like a child_of argument to get a portion of a menu.
Attachments (1)
Change History (8)
#2
@
16 years ago
But the arguments are different: those for wp_get_nav_menu_items mostly have to do with the status and order of the menu items; those for wp_nav_menu mostly have to do with its markup.
#3
@
16 years ago
- Milestone 3.0 → 3.1
- Priority high → normal
- Severity major → normal
- Version → 3.0
And this is not a major issue or one that needs to go into 3.0.
#4
@
16 years ago
I understand that.Thus there is no way to pass args to wp_get_nav_menu_items filter witch makes it useless.
I have one menu. On the top bar, I display it using depth=1 (so it displays the first level) then I have an other one in the side bar. For the last, I get the current page ancestor ID and pass it to wp_nav_menu to get only that submenu.
As it is now, I have no way to do that. Maybe you do ?
#5
@
16 years ago
I think I would take another approach, but if I had to work with that I would set a global variable that let me know whether the current call to wp_get_nav_menu_items were in the sidebar, and then check that global variable within the callback attached to the wp_get_nav_menu_items filter.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch to correct the bug