Dont save empty text attributes

This commit is contained in:
Claudiu Lodromanean 2017-03-01 10:39:08 -08:00
parent 7b2be1d62f
commit e132dcba17
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ class WC_Meta_Box_Product_Data {
$attribute_names_max_key = max( array_keys( $attribute_names ) );
for ( $i = 0; $i <= $attribute_names_max_key; $i++ ) {
if ( empty( $attribute_names[ $i ] ) || ! isset( $attribute_values[ $i ] ) ) {
if ( empty( $attribute_names[ $i ] ) || ! isset( $attribute_values[ $i ] ) || is_string( $attribute_values[ $i ] ) && "" === trim( $attribute_values[ $i ] ) ) {
continue;
}
$attribute_name = wc_clean( $attribute_names[ $i ] );