[wp-trac] [WordPress Trac] #35273: Menus Screen Options: various fixes for the Menus Screen and the Customizer Menus Panel

WordPress Trac noreply at wordpress.org
Thu Dec 31 17:27:07 UTC 2015


#35273: Menus Screen Options: various fixes for the Menus Screen and the Customizer
Menus Panel
----------------------------+-----------------
 Reporter:  afercia         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  4.5
Component:  Menus           |    Version:  4.4
 Severity:  normal          |   Keywords:
  Focuses:  ui, javascript  |
----------------------------+-----------------
 Splitting this out from #35112, see specifically [comment:7:ticket:35112
 comment 7] and [comment:15:ticket:35112 comment 15].

 In the Customizer, `api.Menus.MenusPanel.hidden` returns `undefined` when
 clicking for the first time on the screen options checkboxes.

 [[Image(https://cldup.com/D0Dr9UINiY.png)]]

 Also, the first parameter of `substring()` should be an integer between 0
 and the length of the string. Currently, it works just because
 [https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/substring
 when the argument is NaN, it is treated as 0] so `0` should be used in the
 first place.

 Additionally, the title attribute checkbox ID doesn't match the related
 title attribute ID used in the Menus screen so changing the visibility of
 the Title Attribute field in one of the two screens won't have any effect
 on the second screen. These IDs come from the screen "columns" and they're
 different, just compare
 `WP_Customize_Nav_Menus_Panel::wp_nav_menu_manage_columns()` and
 `wp_nav_menu_manage_columns()` in `/wp-admin/includes/nav-menu.php`.

 In `nav-menu.php` the title attribute column has an ID: 'title-attribute'
 and was added in [32691]. A few days later, the Customizer Menus was
 merged in core and that column has an ID: 'attr-title' see [32806].

 Checkboxes are also in a different order, this doesn't break the
 functionality but wondering if they should be in the same order for
 consistency.

 Basically, the two `wp_nav_menu_manage_columns()` are duplicate and should
 always use the same IDs, wondering if a proper solution would be avoiding
 duplicated code in the first place.

 Note for committers: props to @Asgaros and @azaozz so far.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35273>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list