wp_create_category
wp_create_category ( $cat_name, $category_parent = 0 )
Parameters:- (int|string) cat_name Category name.
- (int) category_parent Optional. ID of parent category.
Returns:Defined at: - Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Description
Adds a new category to the database if it does not already exist.