php – Replace attribute terms with wp_update_term (woocommerce)
On the edit.php?post_type=product&page=product_attributes page I want to replace (when I import a product via my importer plugin) the term name of the Terms attribute with a new name.
For example: if the name ‘Old Name’ exists as (term) change it to ‘New Name’
I used the code:
$nname="New Name"; wp_update_term(69, '1display', array( 'Old Name' => $nname, 'slug' => sanitize_title($nname) ) );
but it was unsuccessful, it didn’t work.
Can you tell me what I’m doing wrong?