Customizer: Prevent a race condition when attempting to publish too soon after updating widget form fields with multiple edits.
props westonruter. fixes #31501. git-svn-id: https://develop.svn.wordpress.org/trunk@31706 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
63502a8a01
commit
72fcd6e2ce
@ -2444,10 +2444,7 @@
|
||||
},
|
||||
|
||||
save: function() {
|
||||
var self = this,
|
||||
query = $.extend( this.query(), {
|
||||
nonce: this.nonce.save
|
||||
} ),
|
||||
var self = this,
|
||||
processing = api.state( 'processing' ),
|
||||
submitWhenDoneProcessing,
|
||||
submit;
|
||||
@ -2455,7 +2452,11 @@
|
||||
body.addClass( 'saving' );
|
||||
|
||||
submit = function () {
|
||||
var request = wp.ajax.post( 'customize_save', query );
|
||||
var request, query;
|
||||
query = $.extend( self.query(), {
|
||||
nonce: self.nonce.save
|
||||
} );
|
||||
request = wp.ajax.post( 'customize_save', query );
|
||||
|
||||
api.trigger( 'save', request );
|
||||
|
||||
|
@ -1028,7 +1028,11 @@
|
||||
}
|
||||
data += '&' + $widgetContent.find( '~ :input' ).serialize();
|
||||
|
||||
if ( this._previousUpdateRequest ) {
|
||||
this._previousUpdateRequest.abort();
|
||||
}
|
||||
jqxhr = $.post( wp.ajax.settings.url, data );
|
||||
this._previousUpdateRequest = jqxhr;
|
||||
|
||||
jqxhr.done( function( r ) {
|
||||
var message, sanitizedForm, $sanitizedInputs, hasSameInputsInResponse,
|
||||
|
Loading…
Reference in New Issue
Block a user