Ticket #16738 (new enhancement)
Add filter for attributes on menu item links
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Menus | Version: | |
| Severity: | normal | Keywords: | dev-feedback has-patch |
| Cc: |
Description
I find myself needing to change the attributes of the link element of each menu item to add some classes. Currently I can do this by extending and substituting Walker_Nav_Menu, but that the start_el method I replace is fairly long and I'm nervous of changes to core breaking my kit in the future. Much better to be able to hook a filter, IMO.
Attachments
Change History
comment:2
simonwheatley — 15 months ago
In the patch I've also changed the way the attributes are built up within start_el so they work with a named array, as it is easier for plugin authors to then parse the attributes as an array than if they are passed a long string of HTML attributes. Hope that makes sense.
Note: See
TracTickets for help on using
tickets.

