Make WordPress Core

Ticket #33176: 33176.diff

File 33176.diff, 1.2 KB (added by westonruter, 8 years ago)

https://github.com/xwp/wordpress-develop/pull/109

  • src/wp-admin/js/customize-nav-menus.js

    diff --git src/wp-admin/js/customize-nav-menus.js src/wp-admin/js/customize-nav-menus.js
    index 185491d..76a1d60 100644
     
    24922492                                oldSection.container.remove();
    24932493                                api.section.remove( oldCustomizeId );
    24942494
    2495                                 // Remove the menu to the nav menu widget template.
     2495                                // Update the nav_menu widget to reflect removed placeholder menu.
    24962496                                navMenuCount = 0;
    24972497                                api.each(function( setting ) {
    24982498                                        if ( /^nav_menu\[/.test( setting.id ) && false !== setting() ) {
     
    25042504                                widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
    25052505                                widgetTemplate.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
    25062506
     2507                                // Update the nav_menu_locations[...] controls to remove the placeholder menus from the dropdown options.
     2508                                wp.customize.control.each(function( control ){
     2509                                        if ( /^nav_menu_locations\[/.test( control.id ) ) {
     2510                                                control.container.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
     2511                                        }
     2512                                });
     2513
    25072514                                // Update nav_menu_locations to reference the new ID.
    25082515                                api.each( function( setting ) {
    25092516                                        var wasSaved = api.state( 'saved' ).get();