php – Replace attribute terms with wp_update_term (woocommerce)
Question
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?
Thank you
0
2 months
2023-09-26T06:09:29-05:00
2023-09-26T06:09:29-05:00 0 Answers
0 views
0
Leave an answer