wp_create_category() from functions.php returns Undefined
-
I’m seeking to test for the existence of a category (by name) and if the category does not exist, I’d like to create it.
I’m using the following code in my theme’s functions.php file…
if(get_cat_ID('hidden')!==1){wp_create_category('hidden');}
However, its returning an undefined function error. I suppose I need to include taxonomy.php in my functions.php?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_create_category() from functions.php returns Undefined’ is closed to new replies.