• Im using Ultimate Member with Paid Membership Pro to manage registration and payment process. The trouble Im having is when I use the registration/checkout page woth PMPro it is automatically assigning users to the default community role. I saw there was a function to change this for Gravity Forms, is there a similar function I can use to reassign the community role upon registration based on the WP role? ie. Pmpro assigns a custom WP role named pmpro1 which I would like to automatically connect with my UM community role named “gold”

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @danser81

    You must synchronize ULTIMATE MEMBER role with WORDPRESS role (Paid Membership Pro).
    To do that please check this video : https://www.opentest.co/share/3c4394d0856211e6ae14b5f543a2f34a.

    Thread Starter mjcreative

    (@danser81)

    I have that set up already but because I am using a separate plugin for the registration piece it isn’t working both ways. It assigns the correct WordPress Role but the community role stays as the default. Essentially when someone registers as (example) ORANGE wordpress role it needs to always assign it to ORANGE community role. I thought there might be a custom function to make this happen similar to the Gravity forms example.

    Hi there, instead of opening a new thread, I bump that one up ??

    We don’t have exactly the same question but it goes in the same direction.

    We have two WP websites with a Single Sign On.

    Site A (the shop) / Site B (the support center)

    ** On site A **
    Users are signing up on Site A. They get the default core WP role. UM is NOT installed on Site A.
    On top of the “basic” WP role, we have two custom roles that we assigned manually (with the plugin User Role Editor).

    Role “1”
    Role “2”

    When users click on “service center” the are redirected on Site B.

    ** On site B **
    We created exactly the same WP core roles than on site A.

    If use arrive from site A with the role 2, he has the same role on Site B.

    => Ultimate Member.
    We created in UM the two roles and names them like our “core custom worpdress role”: “1” & “2”.

    Now our issue:

    We can synchronize with WP role in the direction UM Role to Worpdress role BUT not the opposite.

    What we would like is that when a user arrive from Site A with the WP Role 2, UM automaticaly asign him the corresponding UM Role.

    In the “For developpers” section of the help there is a code example mentionned earlier by danser81: ” Conditionally sync UM user role based on WP role (Gravity forms)”

    
    /* This code will sync the UM role based on WP role using gravity registration */
     
    add_action("gform_user_registered", "um_gravity_user_role_sync", 200, 4);
    function um_gravity_user_role_sync($user_id, $config, $entry, $user_pass) {
     
        $user = new WP_User( $user_id );
        $wp_role = $user->roles[0];
        
        // if WP role is subscriber, set UM role to member
        if ( $wp_role == 'subscriber' ) {
            update_user_meta($user_id, 'role', 'member');
        }
     
    }
    
    

    Is there a way to adapt that code to what we are looking for?

    Thank you VERY much in advance for any help.

    Greetings from Berlin

    Gui

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘assign user role upon registration’ is closed to new replies.