Hi
I'm quite new at this so I apologise in advance if it is obvious
would anyone be able to tell me what code I would need to be able to get a users steam ID to show on a wordpress site page if someone has logged in with steam?
thanks!
Please sign in to your OneAll account to ask a new question or to contribute to the discussions.
Please click on the link below to connect to the forum with your OneAll account.
Answers
Hi Gary,
Sure, to get the Steam ID on WordPress, you can take a look here to use our hook : http://docs.oneall.com/plugins/guide/social-login-wordpress/#3a
The Steam ID should be accessible in the function (from previous link about hook) using this code (not tested) :
if (property_exists($identity, 'accounts') && is_array($identity->accounts))
{
foreach ($identity->accounts as $account)
{
if (!empty($account->userid))
{
$steamID = $account->userid;
}
}
}
Then save it anywhere you want (if you want it to a specific table, or in the user meta) to be able to show it later.
Best regards,
Locksmith Keighley provides trusted and professional services, ensuring quick solutions for lockouts, repairs, and security upgrades. With expertise in residential, commercial, and automotive locks, they deliver reliable assistance whenever needed. Whether it’s emergency access or enhancing home safety, their skilled team is always ready to help. Just like getting steam id within the page after logging in with steam simplifies online gaming, Locksmith Keighley simplifies securing your property with efficiency and care.
Hello Guys,
When you log in with Steam, the SteamID is usually returned through the authentication response or available via the Web API after the session is established. If you’re not seeing it on the page, check the callback URL parameters or inspect the JSON response in your browser’s network tab. That’s often where the ID is exposed before being rendered.I ran into something similar while connecting progress saving for a mini-game project on https://stickmanpartyapks.com, and pulling the ID directly from the auth response solved it. Hope that helps anyone troubleshooting the same issue.