Call to undefined method um\core\User::set_role()
-
Hey, I’m struggling to set role of a user after registration depending on a custom field.
echo $ultimatemember->user()->get_role();
Wroks fine and I already tried using UM() instead of $ultimatemember and get_role(id,role) It’s still undefined for set role….add_action( 'um_after_save_registration_details', 'workflow_mail', 10, 2 ); function workflow_mail( $user_id, $submitted ) { global $ultimatemember; if( empty( $user_id ) ) { $user_id = get_current_user_id(); } echo $taetigkeit = get_user_meta( $user_id, 'taetigkeit', true); um_fetch_user($user_id); echo $ultimatemember->user()->get_role(); if($taetigkeit == '1'){ $ultimatemember->user()->set_role('um_1'); }else{ $ultimatemember->user()->set_role('um_2'); }
Thank you for helping
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Call to undefined method um\core\User::set_role()’ is closed to new replies.