Merge pull request #22740 from woocommerce/fix/22403

Check for decoded taxonomy name when unsetting terms
This commit is contained in:
Mike Jolley 2019-02-19 09:47:20 +00:00 committed by GitHub
commit 9076fde5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -748,6 +748,9 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
if ( taxonomy_exists( $attribute_key ) ) {
// Handle attributes that have been unset.
wp_set_object_terms( $product->get_id(), array(), $attribute_key );
} elseif ( taxonomy_exists( urldecode( $attribute_key ) ) ) {
// Handle attributes that have been unset.
wp_set_object_terms( $product->get_id(), array(), urldecode( $attribute_key ) );
}
continue;