Fix removing attributes
This commit is contained in:
parent
6a40ee9ef4
commit
95e041214b
|
@ -595,6 +595,7 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
|||
$is_taxonomy = ($attribute_is_taxonomy[$i]) ? 1 : 0;
|
||||
|
||||
if ( $is_taxonomy ) {
|
||||
|
||||
if ( isset( $attribute_values[$i] ) ) {
|
||||
|
||||
// Format values
|
||||
|
@ -610,6 +611,10 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
|||
// Remove empty items in the array
|
||||
$values = array_filter( $values );
|
||||
|
||||
} else {
|
||||
$values = array();
|
||||
}
|
||||
|
||||
// Update post terms
|
||||
if ( taxonomy_exists( $attribute_names[$i] ) )
|
||||
wp_set_object_terms( $post_id, $values, $attribute_names[$i] );
|
||||
|
@ -625,7 +630,7 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
|||
'is_taxonomy' => $is_taxonomy
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if ( ! $attribute_values[$i] ) continue;
|
||||
// Format values
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1558,11 +1558,11 @@ img.help_tip {
|
|||
}
|
||||
.expand_all {
|
||||
padding-left: 14px;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARklEQVQYGWP8//8/AzGACV3Rnj17/oMwujiGQnQFMD7RChlBbsRmFcwkEO3i4sJImonIumGmg0xBFifaRKIVgj2DbAUuNgCfThpracSKqwAAAABJRU5ErkJggg==) no-repeat left;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAI0lEQVQYV2PcvXv3fwY8gJEoBa6urozYDAFpBpswGBTg8yYA3kYtiYVhDhIAAAAASUVORK5CYII=) no-repeat left;
|
||||
}
|
||||
.close_all {
|
||||
padding-left: 14px;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAKUlEQVQYlWP8//8/Az7AhFeWGAUsDAwMDHv27MFqj4uLCyNBExhp70gAohwKC5KJ+HQAAAAASUVORK5CYII=) no-repeat left;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAHUlEQVQYV2NkIAAYd+/e/R+fGsIKCFpBUAHt3QAASf0MyQbFJwoAAAAASUVORK5CYII=) no-repeat left;
|
||||
}
|
||||
.toolbar {
|
||||
margin: 0 !important;
|
||||
|
|
Loading…
Reference in New Issue