How set role at registration based on email?
Here is a snippet that assign author role to a new registered member whose email is [email protected] where you need to modify to fit your needs: add_action( ‘user_register’, ‘user_register_cb’, 10, 1 ); function user_register_cb( $user_id ){ $user_info = get_userdata( $user_id ); $email = $user_info->user_email; $domain = ‘.co.uk’; $pos = strpos( $email, $domain ); if( $pos … Read more