Updated filter_pre_get_avatar_data_url so it passes the requested width and height arguments to get_the_post_thumbnail_url
Ensures the requested avatar size ( or the closest your particular combination of theme and hosting environment can produce ) is applied to a guest author's feature image.
Updated filter_pre_get_avatar_data_url so it passes the same arguments it received when recursively calling get_avatar_url
Ensures the requested avatar size is applied to Gravatar images rather than reverting to the default.
Steps to Test
Add the Post Author block to a post or template.
Any changes to the Avatar Size should be reflected in the rendered content.
Inspect the response to a request for /wp-json/wp/v2/users/:user-id/ from the block editor.
The URLs in the avatar_urls object should match their associated keys. For example the default sizes: 24, 48, 96
Inspect the response to a request for /wp-json/coauthors/v1/authors/:post-id/ from the block editor.
For authors using gravatar, the avatar should use the default size of 96px.
For guest authors using a feature image, the value should use the closest available size to 96px.
Inspect the classic editor coauthor meta box.
For authors using gravatar, the avatar should use the default size of 96px.
For guest authors using a feature image, the value should use the closest available size to 96px.
Use your browser's dev tools to turn off JavaScript and open a post in the classic editor.
The coauthor avatars in #coauthors-readonly should be constrained to 25px through CSS.
@GaryJones I updated this pull request to remove var $gravatar_size as discussed in #958 . The desciption and testing steps have been updated accordingly.
Description
Resolves #958
854 may also be resolved by this
filter_pre_get_avatar_data_url
so it passes the requested width and height arguments toget_the_post_thumbnail_url
filter_pre_get_avatar_data_url
so it passes the same arguments it received when recursively callingget_avatar_url
Steps to Test
/wp-json/wp/v2/users/:user-id/
from the block editor.avatar_urls
object should match their associated keys. For example the default sizes: 24, 48, 96/wp-json/coauthors/v1/authors/:post-id/
from the block editor.#coauthors-readonly
should be constrained to 25px through CSS.