Make WordPress Core

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)

patch.txt (1.0 KB ) - added by DreadLox 16 years ago.
Patch to correct the bug

Download all attachments as: .zip

Change History (8)

@DreadLox
16 years ago

Patch to correct the bug

#1 @DreadLox
16 years ago

  • Keywords has-patch added

#2 @filosofo
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 @filosofo
16 years ago

  • Milestone 3.03.1
  • Priority highnormal
  • Severity majornormal
  • Version3.0

And this is not a major issue or one that needs to go into 3.0.

#4 @DreadLox
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 @filosofo
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.

#6 @DreadLox
16 years ago

It is an uggly hack but it could do the trick. Thks.

#7 @nacin
16 years ago

  • Milestone Awaiting Triage
  • Resolutionwontfix
  • Status newclosed
Note: See TracTickets for help on using tickets.