Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
287 stars 205 forks source link

Update Co-Author Avatar block for feature parity with Author Avatar block #1022

Open douglas-johnson opened 4 months ago

douglas-johnson commented 4 months ago

While reviewing https://github.com/Automattic/Co-Authors-Plus/pull/997 @laurelfulford pointed out that the Co-Author Avatar block's image dimension controls don't match the controls for the core Author Avatar block in WordPress 6.4 and above. https://github.com/Automattic/Co-Authors-Plus/pull/997#discussion_r1412700433

Between WordPress 6.3 and 6.4 the Avatar blocks were upgraded to use a range control instead of just the sizes defined in rest_get_avatar_sizes.

This works for Gravatar because the width is defined by a query parameter in the URL. The same does not apply as easily for images uploaded to the WordPress media library because the sizes can be limited to those determined by theme and plugin code.

Since a Co-Author could have either a Gravatar or a featured image that was uploaded to the media library, some work needs to be done to support both use cases in the Co-Author Avatar block.

In https://github.com/Automattic/Co-Authors-Plus/pull/997 there are separate blocks for Co-Author Avatar and a Co-Author Image. I did this to make a clear distinction between Avatar which supports Gravatar and is always square as opposed to Image which supports the media library and has the full dimension controls.

If we have to support all the dimension controls in both blocks, it might make sense to make them into a single block and make Gravatar support an option that is true by default.