Repository navigation
@wordpress/core-data: Fix type Attachment.media_details - #49083
yusuke-omae wants to merge 2 commits into
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @yusuke-omae! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
Thanks for contributing, @yusuke-omae! I believe this issue was resolved in recent updates for attachment types. Here's the latest ref - #73223. |
|
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 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. |
|
Thanks for the ping and for the contribution here! I actually think this one might have been fixed in #64496 last year. We did just update the types again to make them more accurate across the different kinds of potential media types, but that earlier PR swapped out Since this issue has been resolved for a while now, I'll close out this PR, but thanks again for contributing @yusuke-omae! 🙇 |
What?
Fix invalid type
Attachment.media_details.Why?
The current
Attachment.media_detailsisRecord<string,string>, but at least inmedia_detailswith image media, thesizesfield is an object and the types do not match.How?
Define again the fields commonly used for image media. Also, since media such as audio are not necessarily
Record<string,string>, changed toRecord<string,any>.