我对在新添加的产品属性中添加术语有疑问,但是如果我尝试运行wp_insert_term()2次,它将在现有产品属性中添加术语
下面的示例代码:
wc_create_attribute([
'name' => 'Size',
'slug' => 'size'
]);
//use for insert term in created term.
// but it only insert when I refresh the page.
wp_insert_term( 'Large', 'pa_size');