Forked from ultimatemember/gist:962dcd6eaa6db560f6c7
Last active
August 29, 2015 14:24
-
-
Save CoachBirgit/d62bdecdeb8357e59cf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This example syncs both UM / WP role during user approval */ | |
add_action('um_after_user_is_approved', 'sync_um_and_wp_role', 99 ); | |
function sync_um_and_wp_role( $user_id ) { | |
// Get UM role | |
$role = get_user_meta( $user_id, 'role', true ); | |
// Set WordPress role for same user | |
$wp_user_object = new WP_User( $user_id ); | |
$wp_user_object->set_role( $role ); | |
} |
Author
CoachBirgit
commented
Jul 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment