Having trouble storing the discord id after a user signs in with discord/wordpress

I can't seem to get the discord id of a user when they sign in. How would I do it?

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited June 24

    Hello,

    you can use the following hook:
    http://docs.oneall.com/plugins/guide/social-login-wordpress/#3a

    And then a function like this:

    function oa_social_login_store_extended_data ($user_data, $identity)
    {
        if ($identity->source->key == 'discord')
        {
            if (preg_match ('#/([0-9]+)/#', $identity->id, $matches))
            {
                update_user_meta ($user_data->ID, 'discord_userid', $matches[1]);  
            }
        }
    }
    
Sign In or Register to comment.