i am attempting to create a function with user_register to submit new member details when they register to a CRM. in the wordpress guide for user_register https://developer.wordpress.org/reference/hooks/user_register/
it says
“Not all user meta data has been stored in the database when this action is triggered. For example, nickname is in the database but first_name and last_name are not (as of v3.9.1). The password has already been encrypted when this action is triggered.”
this the case, as i found some other info to use post data from the form.
this works…
$FirstName = $_POST[“first_name”];
$LastName = $_POST[“last_name”];
is it possible to use the custom fields from s2member in the same way?
i have tried these and they do not have info when user_register fires.
get_user_option(‘business_name’);
get_user_option(‘business_name’, $user_id);
get_user_field(‘business_name’);
get_user_field(‘business_name’, $user_id);