WordPress wp_set_object_terms does not assign product to custom taxonomy
I can see few potential issues here: wp_insert_post returns post_id or 0 or WP_Error, if you will have WP_Error it will still pass the if ( $porduct_id ). So here you have one potential issue. In description you wrote, that you create fields called “regions”, and in code you have wp_set_object_terms($product_id, $regionId, ‘region’); so here … Read more