strangerstudios / basic-user-avatars

Add an avatar upload field on frontend pages and on the Edit Profile screen so users and admins can manage custom profile pictures without Gravatar.
https://wordpress.org/plugins/basic-user-avatars/
39 stars 34 forks source link

Also pass the user ID to basic_user_avatar filter #27

Closed markjaquith closed 6 years ago

markjaquith commented 6 years ago

The basic_user_avatar filter isn't very useful, because you just get a blob of HTML and you have no idea what user it's for. This adds $user_id to the filter, so you could re-fetch the user meta and re-create the HTML however you wanted.

My use case for this is to append a user-meta-stored version number to the src so that browser caches are immediately invalidated when a user updates their avatar.