Opened 15 years ago
Closed 15 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: | tschoonover | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3.1 |
| Component: | Menus | Version: | 3.3 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.