Hi @sirbenky
Unfortunately, this requires customization on your end.
You can use this function to change a user role:
$user_id = 123;
$user_role_slug = 'subscriber';
UM()->roles()->set_role( $user_id, $user_role_slug );
Let’s see if other has done something similar and share their code here.
Regards,
The thing is the previous roles the user has shouldn’t be replaced
They should be able to fill something like a re-registration form and from there their requests would only require approval
The Tutor LMS plugin devs were able to achieve this where a user even if logged in is able to register through a form in order to request a role upgrade
But I don’t know how to implement this in Ultimate Member… Would really love to have this work
-
This reply was modified 5 years, 2 months ago by
sirbenky.
Hi @sirbenky
sorry for the late response.
Have you tried using the following code to add the role instead of replacing the previous role?
$wp_user_object = new WP_User( $user_id );
$wp_user_object->set_role('editor');
Feel free to re-open this thread by changing the topic status to “Not Resolved” so that we can get back to you.
Regards,