Get registration field names for hook um_registration_complete
-
Hello,
I’m currently trying to set a custom user role before the user redirects. I’m using the hook um_registration_complete for this.
My form has a field called bar_number (example) and I want to retrieve this field in the custom function for the hook, but unfortunately I do not know how.
Code should look something like that
add_action( ‘um_registration_complete’, ‘company_registration_complete’, 10, 2 );
function company_registration_complete( $user_id, $args ) {
// 1. retrieve field (how)
$bar_number = ……?;// 2. unset standard role
$user_id->remove_role(‘um_standard’);if (something == 111) {
// 3. set new role
$user_id->set_role(‘admin’);
}
}`Thanks in advance!
- The topic ‘Get registration field names for hook um_registration_complete’ is closed to new replies.