Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#958/ unable to change avatar images sizes #959

Merged
merged 4 commits into from
Jul 29, 2023

Conversation

douglas-johnson
Copy link
Contributor

@douglas-johnson douglas-johnson commented Jul 27, 2023

Description

Resolves #958
#854 may also be resolved by this

  • 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 GaryJones added this to the 3.6 milestone Jul 28, 2023
@douglas-johnson
Copy link
Contributor Author

@GaryJones I updated this pull request to remove var $gravatar_size as discussed in #958 . The desciption and testing steps have been updated accordingly.

@GaryJones GaryJones merged commit e0485ac into Automattic:master Jul 29, 2023
1 check passed
@GaryJones GaryJones modified the milestones: 3.6, 3.5.12 Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to change avatar image sizes
2 participants