mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 01:00:04 +00:00
Customizer: Update nav_menu_locations[...] controls to remove placeholder menus from the dropdown options upon Save & Publish.
See #32814. Fixes #33176. git-svn-id: https://develop.svn.wordpress.org/trunk@33496 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2492,7 +2492,7 @@
|
||||
oldSection.container.remove();
|
||||
api.section.remove( oldCustomizeId );
|
||||
|
||||
// Remove the menu to the nav menu widget template.
|
||||
// Update the nav_menu widget to reflect removed placeholder menu.
|
||||
navMenuCount = 0;
|
||||
api.each(function( setting ) {
|
||||
if ( /^nav_menu\[/.test( setting.id ) && false !== setting() ) {
|
||||
@@ -2504,6 +2504,13 @@
|
||||
widgetTemplate.find( '.nav-menu-widget-no-menus-message:first' ).toggle( 0 === navMenuCount );
|
||||
widgetTemplate.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
|
||||
|
||||
// Update the nav_menu_locations[...] controls to remove the placeholder menus from the dropdown options.
|
||||
wp.customize.control.each(function( control ){
|
||||
if ( /^nav_menu_locations\[/.test( control.id ) ) {
|
||||
control.container.find( 'option[value=' + String( update.previous_term_id ) + ']' ).remove();
|
||||
}
|
||||
});
|
||||
|
||||
// Update nav_menu_locations to reference the new ID.
|
||||
api.each( function( setting ) {
|
||||
var wasSaved = api.state( 'saved' ).get();
|
||||
|
||||
Reference in New Issue
Block a user