• Hello:

    I am putting together a WordPress site using woo commerce and Ultimate Members. The combo is pretty nice!

    I do have one problem, though. The plugin developers for UM have set roles in their plugin as priority over WordPress. What I mean by that is when a user role changes they change the role for their app and then change the role in WP. if the WP role changes then the UM role does not.

    Woocommerce follows the WP convention and when a user registers through their app they change the WP role.

    To get the two systems to play nice, I need to change the UM role when the WP role changes after a user signs into my site through woo.

    I found this snippet of code that changes the WP role when the UM role changes. I need to swap things around. Can anyone show me the way?

    Here is the snippet:

    add_action(‘um_after_user_is_approved’, ‘sync_um_and_wp_role’, 99 );
    function sync_um_and_wp_role( $user_id ) {
    update_user_meta( $user_id, ‘role’, ‘realtor’);
    $wp_user_object = new WP_User( $user_id );
    $wp_user_object->set_role( ‘realtor’ );
    }

    Thanks, Rich

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator James Huff

    (@macmanx)

    I recommend asking at https://www.ads-software.com/support/plugin/ultimate-member#postform so the plugin’s developers and support community can help you with this.

    Thread Starter iaddic

    (@iaddic)

    Ok..I’ll post there also….But where can I get help with the first part of the equation?

    I am seeking to create a something that looks for a particular user role to be set. When it is, I need to capture it…

    That is a WP action I need help with.

    So when a WP user role, “name a role” changes in WP, I need to capture that so that I can wite/change the Ultimate member role…

    I am not too keen to have to play around with my themes functions.php file for this as I am not a programmer. But I am in need of some help on this…

    Thanks…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP to Ultimate Member sync’ is closed to new replies.