Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

wpForo 1.x.x [Closed] Question about retrieving user avatar from php

3 Posts
2 Users
0 Reactions
1,443 Views
Posts: 21
Topic starter
(@gamedevhq)
Eminent Member
Joined: 6 years ago

Hi, 

I'm working on a plugin that needs to grab the users avatar. Currently, I'm also working with a membership plugin, and we verify if the "account" is verified like this: 

'user_confirmed' => $user->pmpro_email_confirmation_key,

Is there any equivalent to get the avatar url for someone? 

I've tried: 

'avatar' => $wpforo_profiles->avatar

or 

'avatar' = $user->data->avatar 

but both are coming back null. 

Any help would be great! 

To further clarify, here's some other examples that are working. For example, to get the user name: 

'name' => $user->data->user_nicename

Thanks!


2 Replies
Posts: 21
Topic starter
(@gamedevhq)
Eminent Member
Joined: 6 years ago

Solved through global $wpdb


Robert
Posts: 10606
Admin
(@robert)
Support Team
Joined: 10 years ago

You can use this code to get user avatar by UserID:

<?php echo WPF()->member->get_avatar($userid); ?>