Customize: Fix inability to delete nav menus by preventing preview filters from being added during customize_save admin ajax request.

Also prevent setting `nav_menu_locations[...]` values to `NaN` which gets sent as `null`.

Amends [38810].
See #30937.
Fixes #39103.


git-svn-id: https://develop.svn.wordpress.org/trunk@39558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2016-12-10 06:29:12 +00:00
parent 09df948303
commit be8caefd82
2 changed files with 12 additions and 9 deletions

View File

@@ -1177,7 +1177,11 @@
// @todo It would be better if this was added directly on the setting itself, as opposed to the control.
control.setting.validate = function( value ) {
return parseInt( value, 10 );
if ( '' === value ) {
return 0;
} else {
return parseInt( value, 10 );
}
};
// Edit menu button.