Reply To: $user_id not returned in user_register()

Home Forums Everest Forms $user_id not returned in user_register() Reply To: $user_id not returned in user_register()

#14260

rumesh38
Moderator

Hi there,

The hook action is not correct. You can use do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id ); this hook to get user_id. This hook is called after the user have been registered.

Your code must be like this :

add_action( ‘user_registration_after_register_user_action’, ‘myplugin_registration_save’, 10, 1 );
function myplugin_registration_save( $form_data, $form_id, $user_ID ) {
    add_user_meta(17,’nøkkel’,$user_ID,true);
}

Thanks & Regards,
WPEverest Support Team.