• Resolved sirbenky

    (@sirbenky)


    I want registered users on my site to be able to request an upgrade to their Ultimate Member Role and from their submissions, I can easily choose to bulk upgrade their roles… Is there a way to achieve this in Ultimate Member?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    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,

    Thread Starter sirbenky

    (@sirbenky)

    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 3 years, 10 months ago by sirbenky.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    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,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Allow Registered Users Request Role Upgrade’ is closed to new replies.