Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

facepiles: make sure avatars are always visible images #127

Merged
merged 4 commits into from
Nov 16, 2017

Conversation

snarfed
Copy link

@snarfed snarfed commented Nov 13, 2017

fixes #116

If the WordPress default avatar setting is blank, switch it to a visible placeholder, since this is a facepile. Also inject a JS fallback to a visible placeholder image, since webmention author images are usually remote, and can disappear over time.

screenshot:

image

@pfefferle
Copy link
Owner

I would like to move the code to the avatar code, to have a better encapsulation

public static function pre_get_avatar_data( $args, $id_or_email ) {

@snarfed
Copy link
Author

snarfed commented Nov 16, 2017

sure! will do.

fixes pfefferle#116

If the WordPress default avatar setting is 'blank', switch it to a visible placeholder, since this is a facepile. Also inject a JS fallback to a visible placeholder image, since webmention author images are usually remote, and can disappear over time.
i had to do this, instead of the earlier code that used wordpress's `get_avatar` filter, because i only want it to run for facepile avatar images, and i couldn't find a way to pass a flag through to the `get_avatar` filter to tell it whether the current avatar is in a facepile or not.
...e.g. when the browser has tracking protection on and blocks loading the gravatar URL, which re-triggers the onerror handler.
@snarfed
Copy link
Author

snarfed commented Nov 16, 2017

ok! it's better encapsulated now. not in pre_get_avatar_data, because it needs to edit the generated HTML, but in its own new filter, outside of list_linkbacks.

@pfefferle pfefferle merged commit bb4d661 into pfefferle:master Nov 16, 2017
@snarfed
Copy link
Author

snarfed commented Nov 16, 2017

yay thank you!

snarfed referenced this pull request in snarfed/wordpress-semantic-linkbacks Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

facepiles: handle missing profile pictures
2 participants