Using a built in wordpress function (if available) how do I create a new category in wordpress if it doesn't exist.
I'm using wp_insert_post to insert posts, but I want to be able to do custom categories.
Thanks
-Brad
Using a built in wordpress function (if available) how do I create a new category in wordpress if it doesn't exist.
I'm using wp_insert_post to insert posts, but I want to be able to do custom categories.
Thanks
-Brad
You can use wp_create_categories('catname') and to get_cat_ID('catname') to get the id.
wp_create_categories
get_cat_ID