wp-admin/includes/taxonomy.php:78Creates categories for the given post.
$categoriesstring[]$post_idintoptional0int[]function wp_create_categories( $categories, $post_id = 0 ) { $cat_ids = array(); foreach ( $categories as $category ) { $id = category_exists( $category ); if ( $id ) { $cat_ids[] = $id; } else { $id = wp_create_category( $category ); if ( $id ) { $cat_ids[] = $id; } } } if ( $post_id ) { wp_set_post_categories( $post_id, $cat_ids ); } return $cat_ids;}Introduced in 2.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-admin/includes/taxonomy.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.