Is there an option to create a category with a custom ID, like a custom post ID is created using the parameter
$post = array( 'post_title' => 'whatever', 'post_content' => 'whatever', 'import_id' => 123 ); wp_insert_post( $post );
What I want to do is create a custom post type using
wp_insert_post and will import data from a table which has a category ID attached.
So I want to create categories with custom IDs that are attached to a products table.
Right now I'm using a custom field added to categories as
OLD_CATEGORY_ID and get posts against this custom field ID.
Categories are also imported to WordPress.
Is there a better way, or is this the only way? :)