Make WordPress Core

Changeset 33496


Ignore:
Timestamp:
07/29/2015 07:33:07 PM (9 years ago)
Author:
westonruter
Message:

Customizer: Update nav_menu_locations[...] controls to remove placeholder menus from the dropdown options upon Save & Publish.

See #32814.
Fixes #33176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r33488 r33496  
    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 ) {
     
    25042504                widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
    25052505                widgetTemplate.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
     2506
     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                });
    25062513
    25072514                // Update nav_menu_locations to reference the new ID.
Note: See TracChangeset for help on using the changeset viewer.