Created
January 10, 2019 05:26
-
-
Save Musilda/b77a94b43dfe508d6a30d0ecc20051bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$product_id = 111; | |
wp_remove_object_terms( $product_id, 'simple', 'product_type' ); | |
wp_set_object_terms( $product_id, 'variable', 'product_type', true ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
A product can't be of multiple types, isn't this enough?
This should delete any existing
product_type
values and set onlyvariable
.