wp-admin/includes/taxonomy.php:55Adds a new category to the database if it does not already exist.
$category_namestring$category_parentintoptional0intfunction wp_create_category( $category_name, $category_parent = 0 ) { $id = category_exists( $category_name, $category_parent ); if ( $id ) { return (int) $id; } return wp_insert_category( array( 'cat_name' => $category_name, 'category_parent' => $category_parent, ) );}Introduced in 2.0.0. 3 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$category_name added.verified against source$cat_name removed.verified against sourceint|WP_Error to int.verified against sourcesrc/wp-admin/includes/taxonomy.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.