Revert "Improved performance when saving variations"

This commit is contained in:
Christopher Allford 2020-03-17 08:55:09 -07:00 committed by GitHub
parent 9431b34f0d
commit 1358cca6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 25 deletions

View File

@ -447,31 +447,7 @@ jQuery( function( $ ) {
* @return {Object}
*/
get_variations_fields: function( fields ) {
var data = {};
$( ':input', fields ).each( function( index, elem ) {
var $input = $( elem );
// Bypass inputs without name att
if ( ! elem.name ) {
return;
}
// Bypass non-checked checkboxes and radio buttons.
if ( ( $input.is( ':radio' ) || $input.is( ':checkbox' ) ) && ! $input.is( ':checked' ) ) {
return;
}
// Bypass disabled fields.
if ( true === $input.prop( 'disabled' ) ) {
return;
}
data[ elem.name ] = elem.value;
});
var data = $( ':input', fields ).serializeJSON();
$( '.variations-defaults select' ).each( function( index, element ) {
var select = $( element );