Notifications
Clear all

Script How to call the custom WPForo avatar in the frontend?

4 Posts
2 Users
0 Likes
284 Views
lucasvlc
Posts: 15
Topic starter
(@lucasvlc)
Active Member
Joined: 9 months ago

Hello, I'd like to know what is the name of the custom field used as an avatar for users. I need to call it in a different page and I don't know the name.... thanks in advance

wpForo Version
1.9.9.1
7.4
Topic Tags
3 Replies
Chris
Posts: 1945
Admin
(@chris)
Support Team
Joined: 1 year ago

Hi @lucasvlc,

wpForo is well integrated with WordPress, and if you Enable Replace Author Avatar with Forum Profile Avatar from Dashboard > Forums > Settings > Features you can call Avatars using the below WordPress Function code:

get_avatar( mixed $id_or_email, int $size = 96, string $default = '', string $alt = '', array $args = null )
Reply
lucasvlc
Posts: 15
Topic starter
(@lucasvlc)
Active Member
Joined: 9 months ago

Ok, but I need to change the avatar from a form in the account page... I am building a dashboard and it has a form where user can update the data from his profile. For this I need to know where is the avatar data managed by WPForo saved...

Reply
1 Reply
Chris
Admin
(@chris)
Joined: 1 year ago

Support Team
Posts: 1945

@lucasvlc,

prefix_wpforo_profiles > avatar column.

You need to reset wpForo User Cache after the Data update. Call the below php funtion to reset wpForo User Cache:

WPF()->member->reset( $userid );
Reply
Share: