Opened 14 years ago
Closed 14 years ago
#20483 closed enhancement (fixed)
Do not output nav menu class attribute if no classes exist
| Reported by: | niallkennedy | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | Menus | Version: | |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Walker_Nav_Menu->start_el passes an array of class names and a string through class and id filters respectively. It's possible for a theme or plugin to empty out a class or id, overriding defaults.
The element string builder checks for an empty id attribute string value before outputting the id attribute. If a plugin empties the classes array then $classes_name will be similarly empty.
Patch applies the same conditional attribute output logic present in the id attribute to the class attribute as well.
Attachments (1)
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
check if classes_name is an empty string before building an empty attribute for a nav menu walker element