wp_insert_term auto unique name
-
Hi,
When creating a new term in a custom taxonomy with wp_insert_term, i’ve noticed that name should be unique.
I get a wp error message if it is not :
A term with the name provided already exists with this parent.
I would like a way to automatically check if name is already exist and append it if yes.So check :
get_term_by('id', $term_id, $taxonomy);
and if term exists append the name.but is there a way to auto this with WP ? Like WP does with slug ?
Why should the name be unique, don’t understand as the slug is…thanks a lot !
Fran?ois
- The topic ‘wp_insert_term auto unique name’ is closed to new replies.