I've got an array of data with which I'd like to update my products categories (taxanomy) metadata. Specifically, I'm trying to update description
as well as thumbnail url
values. I tried to use multiple wordpress functions but none of them worked! I didn't get any error but those values didn't get updated either.
$row_data = array(
'Term ID' => 150,
'Name' => "my 1st category",
'Slug' => "my-1st-category",
'Term URI' => "",
'Parent Term ID' => "",
'Description' => "My best description on this category that would change your life forever!",
'Display Type' => "",
'Image' => "https://myexample.site/wp-content/"
);
// This did not work!
wp_update_term($row_data['Term ID'], 'product_cat', $row_data);
// This did not work either!
update_term_meta($row_data['Term ID'], 'description', $row_data['Description']);
// This did not work either!
update_woocommerce_term_meta($row_data['Term ID'], 'thumbnail_id', $row_data['Image']);
Is there something that i'm missing?
Is thumbnail_id
the right field name that i'm using here?
Is update_woocommerce_term_meta
the right function for updating the thumbnail url?
Thank you.