Hi,
Updating the avatar works – just hit Browse, navigate to your avatar file and then click Update profile. The new avatar is saved in DB, but it is not displayed, because it is filtered from the very beginning by WP First Letter Avatar. But it is saved properly and will work after you deactivate my plugin.
I looked into it and, honestly, I don’t think it is a good idea to add compatibility between these two plugins. They both work exactly the same way – they filter WP get_avatar
hook, so they both work against each other. The one which gets executed later wins, the one that was executed earlier has no effect.
There are many avatar plugins for WordPress and they all store their avatars differently, so I would have to include them all in my code, so that my code would “give way” to them all. Including all this exclusions is of course impossible, but even if it was – I don’t think it is a good idea. I think you should decide on one avatar system. WP First Letter Avatar gives you two options – look for Gravatar first, if no Gravatar found – use first letter avatar. If you want to add custom users avatar to the equation, that would be 3 options already available for just displaying the avatar. Prioritizing all these options to make them work in every environment (including compatibilty with other plugins that may interfere with them) would be a nightmare. So if you ask me, I think you should just decide on one avatar system/plugin. Having more of them is just like having multiple cache or SEO plugins – they will only get in each other’s way and nothing good will come out of this.
However…
If you really want to have WP First Letter Avatar + custom users avatar, with custom avatars having priority over letter avatars, you may want to try a small tweak. Because both plugins use get_avatar
filter and it happens that they both use the same priority value (10
), you can modify it in PHP file. So you can either decrease the priority of my plugin or increase the priority of the other avatar plugin.
First option:
Go to lines 80
and 85
of wp-first-letter-avatar.php
in wp-first-letter-avatar
plugin dir and change the 10
parameter in add_filter()
functions to 9
. You need to change it in these two lines.
Second option:
Go to line 73
of init.php
file in basic-user-avatars
plugin dir and change the 10
parameter in add_filter()
functions to 11
.
After this modification, it will work the way you want it to work. User avatar first, if no avatar chosen by the user – WP First Letter Avatar takes over the avatar filter.
I may consider adding a Priority field in plugin settings. That way advanced users could adjust priority of filter execution to make them compatible with any plugin that may interfere with their functionality (increase or decrease the priority). But I’m still not too sure about it; other plugins don’t have this feature.
Really, from my experience – two plugins hooking into the same functions to get the same results, will always be problematic and should be avoided as much as possible.
I hope you find this explanation satisfying!
Cheers,
Dan