[wp-trac] [WordPress Trac] #16724: Add current-menu-item to custom links that only contains path
WordPress Trac
wp-trac at lists.automattic.com
Wed Mar 2 16:17:49 UTC 2011
#16724: Add current-menu-item to custom links that only contains path
--------------------------+-----------------------------
Reporter: chrisbliss18 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 3.1
Severity: normal | Keywords: has-patch
--------------------------+-----------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16724>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list