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?


  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited June 24


    you can use the following hook:

    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.