I must be missing something now
I’ve included this in my functions.php
add_action('user_register', 'auto_create_category');
function auto_create_category($user_id) {
$category_fields = array('cat_name' => $_POST['first_name'],
'category_description' => '',
'category_nicename' => $_POST['first_name'],
'category_parent' => ''
);
$category_fields_id = wp_insert_category($category_fields);
}
But when I register a user, the screen goes white. The user is created, but fails creating the category