Opened 12 years ago
Closed 12 years ago
#20483 closed enhancement (fixed)
Do not output nav menu class attribute if no classes exist
Reported by: | niallkennedy | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | trivial | Version: | |
Component: | Menus | Keywords: | has-patch |
Focuses: | Cc: |
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.
check if classes_name is an empty string before building an empty attribute for a nav menu walker element