Opened 14 years ago
Closed 14 years ago
#19699 closed defect (bug) (fixed)
current-menu-item and current_page_item classes incorrectly added to custom menu items with no URL value.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.3.1 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | Menus | Keywords: | |
Focuses: | Cc: |
Description
If the current page is the home page, the _wp_menu_item_classes_by_context function will incorrectly add the current-menu-item and current_page_item classes to any custom menu items that do not have a value for URL. This occurs because the custom menu item URL (after formatting) compares equal to the home page URL.
Note - a custom menu item might not have a URL value if it is used as only a parent container for another submenu.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Caused by [18746] for #15954 because $_root_relative_current is an empty string for the home page. We could check if the URL is empty for custom menu items before adding classes.