Improved performance when saving variations
The serializeJSON function was causing a long delay when preparing the JSON if there are many input fields within the variations (even worse if 3rd party plugins add their own extra fields there too).
This commit is contained in:
parent
dbb8ab8d1e
commit
37d7d498ec
|
@ -447,8 +447,13 @@ jQuery( function( $ ) {
|
|||
* @return {Object}
|
||||
*/
|
||||
get_variations_fields: function( fields ) {
|
||||
var data = $( ':input', fields ).serializeJSON();
|
||||
|
||||
|
||||
var data = {};
|
||||
|
||||
$( ':input', fields ).each( function(index, elem) {
|
||||
data[elem.name] = elem.value;
|
||||
});
|
||||
|
||||
$( '.variations-defaults select' ).each( function( index, element ) {
|
||||
var select = $( element );
|
||||
data[ select.attr( 'name' ) ] = select.val();
|
||||
|
|
Loading…
Reference in New Issue