During the user registration process in Drupal 7, at which point can I access the newly created UID to create 'default content' for that user? I would like to do this as early on as possible. Preferably before the user has been approved by an admin or before they have verified their email address.
2 Answers
You can use hook_user_insert(), it should be early enough for you.
Technically speaking, hook_user_presave() is the first hook called from user_save() (even before the user is written to the database), but according to the documentation it is "primarily intended for modules that want to store properties in the serialized {users}.data column". More importantly, it is also invoked when a user account is updated, so that wouldn't fit your use case.