Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
Created March 19, 2015 18:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ultimatemember/8743ef32801f7bf08c82 to your computer and use it in GitHub Desktop.
Save ultimatemember/8743ef32801f7bf08c82 to your computer and use it in GitHub Desktop.
All members to automatically be WP contributors when they sign up via UM
add_action('um_after_user_is_approved', 'wp_role_contributor_after_um', 99 );
function wp_role_contributor_after_um( $user_id ) {
$wp_user_object = new WP_User( $user_id );
$wp_user_object->set_role( 'contributor' );
}
@pjeaje
Copy link

pjeaje commented Dec 24, 2015

Can't this be done via the normal WP option of setting the default registration role in WP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment