[wp-trac] [WordPress Trac] #39362: Checkbox control for 'Automatically add new top-level pages to this menu' not wrapped in checkbox customize control

WordPress Trac noreply at wordpress.org
Wed Dec 21 19:55:23 UTC 2016


#39362: Checkbox control for 'Automatically add new top-level pages to this menu'
not wrapped in checkbox customize control
---------------------------+------------------------------
 Reporter:  dingo_bastard  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Customize      |     Version:  4.7
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by dingo_bastard):

 From what I see when I inspect it, it's wrapped in a

 {{{
 <li id="customize-control-nav_menu-123-auto-add" class="customize-control
 customize-control-nav_menu_auto_add" style="display: list-item;"></li>
 }}}

 If there could be added a {{{customize-control-checkbox}}} class without
 it disrupting anything, that would also work as well.

 In the \wp-admin\js\customize-nav-menus.js there is (I guess) a wrapper
 for that control on line 995 so my guess that the class should be added
 there

 {{{
 // Add the control for managing the menu auto_add.
 menuAutoAddControlId = section.id + '[auto_add]';
 menuAutoAddControl = api.control( menuAutoAddControlId );
 if ( ! menuAutoAddControl ) {
         menuAutoAddControl = new api.controlConstructor.nav_menu_auto_add(
 menuAutoAddControlId, {
                 params: {
                         type: 'nav_menu_auto_add',
                         content: '<li id="customize-control-' +
 section.id.replace( '[', '-' ).replace( ']', '' ) + '-auto-add" class
 ="customize-control customize-control-nav_menu_auto_add customize-control-
 checkbox"></li>', // @todo core should do this for us
                         label: '',
                         active: true,
                         section: section.id,
                         priority: 999,
                         settings: {
                                 'default': section.id
                         }
                 }
         } );
         api.control.add( menuAutoAddControl.id, menuAutoAddControl );
         menuAutoAddControl.active.set( true );
 }
 }}}

 I added it in my local testing enviroment, but haven't tested to see if
 this will affect the behavior in any way.

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


More information about the wp-trac mailing list