wp_create_categories
wp_create_categories ( $categories, $post_id = '' )
Parameters:- (string[]) categories Array of category names to create.
- (int) post_id Optional. The post ID. Default empty.
Returns:- (int[]) Array of IDs of categories assigned to the given post.
Defined at: - Introduced in WordPress: 2.0.0
- Deprecated in WordPress: —
Description
Creates categories for the given post.