Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#19064 closed enhancement (fixed)

Pass $depth argument to nav_menu_css_class filter

Reported by: cyclometh's profile cyclometh Owned by: cyclometh's profile cyclometh
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.2.1
Component: Menus Keywords: has-patch needs-docs
Focuses: Cc:

Description

function start_el() in nav-menu-template.php receives a $depth argument, representing the nesting level of the current menu item, but does not pass it to the nav_menu_css_class filter.

Passing the $depth argument allows one to create classes on a menu item such as menu-item-depth-1, menu-item-depth-2, etc by hooking the nav_menu_css_class filter.

Attachments (3)

nav-menu-template.php.diff (736 bytes) - added by cyclometh 13 years ago.
Attaching patch. Updates only one file, nav-menu-template.php.
nav-menu-template.php.2.diff (809 bytes) - added by chriscct7 10 years ago.
19064.3.diff (796 bytes) - added by kpdesign 10 years ago.
Add 4.1.0 changelogs

Download all attachments as: .zip

Change History (20)

@cyclometh
13 years ago

Attaching patch. Updates only one file, nav-menu-template.php.

#1 @Cyclometh
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#2 @ocean90
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Tickets are marked as fixed when a change is made to the WordPress codebase, the patch here still needs to be committed before the ticket will be marked as such.

#3 @Cyclometh
13 years ago

I see, I thought it was in limbo because it was assigned to me and not resolved although it had a patch. Thank you for the clarification.

#4 @soulseekah
12 years ago

  • Cc gennady@… added

#5 @soulseekah
12 years ago

  • Version changed from 3.2.1 to 3.3.1

#6 @ocean90
12 years ago

  • Version changed from 3.3.1 to 3.2.1

Version number indicates when the enhancement was initially reported.

#7 @soulseekah
12 years ago

I see, I thought it was in limbo because it was a lower version and not resolved although it had a patch. Thank you for the clarification.

#8 @chriscct7
10 years ago

  • Severity changed from minor to normal

Patch is still valid

#9 @johnbillion
10 years ago

  • Keywords needs-docs added

Patch needs a hook doc.

#10 @chriscct7
10 years ago

  • Keywords needs-docs removed

Adds docs for the patch

#11 @chriscct7
10 years ago

  • Keywords commit added

Milestone needs to be set to 4.1 but other then that this is good to go now. Pretty straightforward patch: 1 line added for adding the doc for a new depth parameter, 1 line changed for actually adding it

#12 @johnbillion
10 years ago

  • Milestone changed from Awaiting Review to 4.1

#13 @johnbillion
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 30358:

Add $depth parameter to the nav_menu_css_class, nav_menu_item_id, and nav_menu_link_attributes filters.

Fixes #19064
Props cyclometh, chriscct7, johnbillion

#14 @johnbillion
10 years ago

Added the $depth parameter to all three of the filters in that method.

#15 @DrewAPicture
10 years ago

  • Keywords needs-docs added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

A 4.1.0 entry should be added to the changelogs for those three hooks where the $depth parameter was added:

  • nav_menu_css_class
  • nav_menu_item_id
  • nav_menu_link_attributes

@kpdesign
10 years ago

Add 4.1.0 changelogs

#16 @kpdesign
10 years ago

19064.3.diff adds 4.1.0 changelogs for the nav_menu_css_class, nav_menu_item_id, and nav_menu_link_attributes hooks per comment:15.

#17 @DrewAPicture
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 30485:

Update the DocBlock changelogs for the nav_menu_css_class, nav_menu_item_id, and nav_menu_link_attributes hooks following [30358], where $depth parameters were added.

Props kpdesign.
See [30358]. Fixes #19064.

Note: See TracTickets for help on using tickets.