php-initial-avatar-generator icon indicating copy to clipboard operation
php-initial-avatar-generator copied to clipboard

Wordpress Plugin

Open abecoffman opened this issue 7 years ago ā€¢ 7 comments

Hi There,

Would you be interested in turning this into a Wordpress Plugin for generating a custom default avatar for comments? I would be very keen to use something like that. The idea would be to use their gravatar by default, but if they didn't have one, then fall back to this library to generate an image with their initials and a random color. You've done all the hard work so turning into a plugin would be pretty straightforward.

Cheers Abe

abecoffman avatar Sep 24 '17 04:09 abecoffman

Hi!

Could be quite cool! Absolutely. Where are these avatars be displayed? Iā€™m not much into Wordpress šŸ˜¬

Cheers

LasseRafn avatar Sep 24 '17 10:09 LasseRafn

Would you happen to have any idea how to modify profile pictures with code in Wordpress?

LasseRafn avatar Sep 24 '17 13:09 LasseRafn

So the best way to do it would be to use a filter on the get_avatar() function. More info can be found here: https://codex.wordpress.org/Plugin_API/Filter_Reference/get_avatar

This plugin does something similar, but not as well. https://github.com/Dev49net/wp-first-letter-avatar

abecoffman avatar Sep 24 '17 14:09 abecoffman

Great, seems pretty straightforward! I will setup a plugin very soon šŸ‘

I will be creating a tiny web API for this package first (it's ready, I just need to publish it), which can also act as an optional fallback for Wordpress users using a hosting provider that does not support required extensions.

API: https://github.com/LasseRafn/ui-avatars Plugin source coming here: https://github.com/LasseRafn/wordpress-initials-avatar

LasseRafn avatar Sep 25 '17 11:09 LasseRafn

šŸ‘

abecoffman avatar Sep 29 '17 17:09 abecoffman

I've submitted a v0.5 for review at Wordpress šŸ‘

LasseRafn avatar Oct 03 '17 21:10 LasseRafn

This one will use the public api that I released recently, but I am already working on one that generates the avatars on-server. I just had some issues with generating a url for the avatar when using on-server.

LasseRafn avatar Oct 03 '17 21:10 LasseRafn