[wp-trac] [WordPress Trac] #32681: Shift-clicking a menu item in the website preview iframe should open it inside the customiser

WordPress Trac noreply at wordpress.org
Tue Feb 9 22:50:20 UTC 2016


#32681: Shift-clicking a menu item in the website preview iframe should open it
inside the customiser
------------------------------+--------------------------
 Reporter:  paulwilde         |       Owner:  westonruter
     Type:  feature request   |      Status:  reopened
 Priority:  normal            |   Milestone:  4.5
Component:  Customize         |     Version:  4.3
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  javascript
------------------------------+--------------------------
Changes (by westonruter):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 One thing we missed here. When a nav menu is rendered out multiple times,
 only the first instance will include nav menu items that have ID
 attributes. This is to ensure that two elements don't have the same ID in
 the page. The `_nav_menu_item_id_use_once` function does this for the
 `nav_menu_item_id` filter.

 So we need to change the selector from `.menu-item[id^=menu-item-]` to
 just `.menu-item`, and also to look at the class name instead of the ID on
 the actual nav menu items, as so:

 {{{#!diff
 - navMenuItemParts = $( this ).attr( 'id' ).match( /^menu-item-(\d+)$/ );
 + navMenuItemParts = $( this ).attr( 'class' ).match( /(?:^|\s)menu-
 item-(\d+)(?:\s|$)/ );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32681#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list