The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Avatar not Updating

7 Posts
3 Users
1 Reactions
1,213 Views
Posts: 47
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@aaronmckeon)
Trusted Member
Joined: 4 years ago
[#7287]

We're experiencing an issue on our website where avatars are being updated in the user's profile but aren't changing in actual comment threads.  For example, see attached screenshots.  Can you please assist?  Thanks.

-- Aaron

user settings has avatar
no avatar in comments

 


6 Replies
Asti
Posts: 8215
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi Aaron,

Please let us know how the avatars are being uploaded. Do you use some specific plugin? Are all caches deleted properly before checking?  


Posts: 27
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@smilebeda)
Eminent Member
Joined: 4 years ago

Hi @asti - Beda here, I work with Aaron on this project.

We are using the default WordPress `get_avatar_url` filter ( https://developer.wordpress.org/reference/hooks/get_avatar_url/ ) to modify the avatars of users on this website.
We pass it a value of an Image URL stored in a User's meta. Works great on every instance where someone uses `get_avatar_url`.

I debugged the code we use, and confirmed that the filter _always_ returns the right image URL even in the WP Discuz comments section, but, for some reason WPDiscuz seems to alter that _after_ (or independently of) WP avatar filter, thus resulting in an `img src` value that is not filtered and therefore our custom images are not loaded, instead, the _gravatars_ of those users are loaded.

So I suspect, just like you have a filter to alter the _url_ applied to that avatar (and username) on WPDiscuz (`wpdiscuz_profile_url`) you probably have a filter to alter the _image src_ value  - maybe something like `wpdiscuz_profile_img_url` - that we can hook our code to?

I have found https://wpdiscuz.com/docs/codex/filters/wpdiscuz_author_avatar_field/ , but this is inadequate - we do not want to get avatar by another email or user id values, we want to put our own modified URL there (it is actually an URL stored in a User Meta Field, but this really should not matter)
https://wpdiscuz.com/docs/codex/filters/wpdiscuz_avatar_link_attributes/ also is inadequate since it seems to target the _link_ wrapping the img (so not allowing us to change the img src attribute)

Could you point me to the right filter you use so I can hook our code to that one as well and return a modified img src value?


4 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hi Beda,

The developers are checking this problem. I'll update this topic once I get a response from them. 


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Dear Beda, Aaron,

This is a cache issue for sure. Please delete all kinds of caches (server-side, website, wpDiscuz, browser) before checking. 

The wpDiscuz caches can be deleted in the Dashboard > wpDiscuz > Settings > General Settings tab. The option is called "Purge Comment and User Caches". 


(@aaronmckeon)
Joined: 4 years ago

Trusted Member
Posts: 47
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti I have taken your advice and avatars seem to be displaying correctly now.  That said, will this problem continue to happen every time we update the user's avatar?  Are there any wpDiscuz hooks we can use to force the avatar cache to clear for just a single user in wpDiscuz whenever we use the WordPress hook as described by Beda?

Thanks!


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Asti
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@aaronmckeon,

I may suggest you just disable the wpDiscuz Cache option. It's located in the Dashboard > wpDiscuz > Settings > General Settings tab. 

image

Share: