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
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?
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?