Add current-menu-item to custom links that only contains path
|Reported by:||chrisbliss18||Owned by:|
It is possible to add a custom link to a menu with a URL that only contains a path, such as "/contact". The link will work properly, but the menu item will not receive the current-menu-item class when that page is active.
The supplied patch (current-menu-item-custom-link-path.diff) allows the current-menu-item class to be applied to the path-only custom links by prepending the current request's scheme and domain to the link, turning it into a complete URL, before running the check.
The patch considers a link as an incomplete URL if it begins with a forward-slash (/). This way, complete URLs (which will always begin with a letter from the scheme) will be unmodified.
Change History (6)
- Type changed from defect (bug) to enhancement
- Version changed from 3.1 to 3.0