Fix attribute saving
This commit is contained in:
parent
3d2b0ab72b
commit
178f98ff65
|
@ -1104,7 +1104,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$attributes = array_fill_keys( array_keys( $this->get_attributes( 'edit' ) ), null );
|
||||
foreach ( $raw_attributes as $attribute ) {
|
||||
if ( is_a( $attribute, 'WC_Product_Attribute' ) ) {
|
||||
$attributes[ sanitize_text_field( $attribute->get_name() ) ] = $attribute;
|
||||
$attributes[ sanitize_title( $attribute->get_name() ) ] = $attribute;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -631,7 +631,7 @@ class WC_AJAX {
|
|||
$i = -1;
|
||||
|
||||
foreach ( $data['attribute_names'] as $attribute_name ) {
|
||||
$attribute = isset( $attributes[ $attribute_name ] ) ? $attributes[ $attribute_name ] : false;
|
||||
$attribute = isset( $attributes[ sanitize_title( $attribute_name ) ] ) ? $attributes[ sanitize_title( $attribute_name ) ] : false;
|
||||
if ( ! $attribute ) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue