Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @eric-michel. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I've not properly tested this, but I think the Featured Image won't retain the aspect ratio after the update.
|
Hi @Mamaduka, I tried the above steps and yes, the aspectRatio which is set is no more used. We need to make sure it is backward compatible, if aspectRatio is set, it should respect that, and if changed then we can use new one. Let me know if you have some idea how can we proceed with that? I tried some findings but did not succeed. Maybe we should retain the attribute and check if that is set, use that, and once change it from block support make it undefined. I am not sure what could be the better approach. Thank You. |
| } ) ); | ||
|
|
||
| // Get the block Supports aspect ratio. | ||
| const aspectRatio = attributes?.style?.dimensions?.aspectRatio; |
There was a problem hiding this comment.
const aspectRatio = attributes?.style?.dimensions?.aspectRatio;
Above line can be changed to something like,
const blockSupportAspectRatio = attributes?.style?.dimensions?.aspectRatio || aspectRatio;
Here we should not remove the attribute from the block itself, we just keep it to get the value which was stored previously?
But it would have issue like, blockSupport aspectRatio dropdown would not show the selected aspectRatio from the atttribute.
|
@hbhalodia can you confirm if this implementation of |
What?
Resolves #61432
Why?
aspectRatiofrom attributes and used theBlock Supportsfor thecore/post-featured-image, because the attributes were redundant.How?
aspectRatiofrom the attributes.block supports,dimensions[aspectRatio]in block.json.Testing Instructions
core/post-featured-imageblock.Testing Instructions for Keyboard
Screenshots or screencast