I’m using wp_insert_term
which works quite well
Now I want some error handler for when using the same name.
$term_id = wp_insert_term( $term, 'wpsc_product_category', $args );
if($term_id) {//my operations here}
where $term = $_POST['categoryTitle'];
I want to display some error when such name already exists.
In wp_insert_term, how to check if this $term_id
is duplicate?
I don’t want to continue my operations on already existing terms.
See if that works for you.