-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Media Text Block: Image size option for featured image #67464
base: trunk
Are you sure you want to change the base?
Media Text Block: Image size option for featured image #67464
Conversation
Size Change: +107 B (+0.01%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
…nt/resolution-option-for-featured-image-media-text-block
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. |
Flaky tests detected in d32454f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12118987166
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together @akasunil 👍
It looks like this PR makes an unintended change to the way image urls fallback i.e. they no longer prefer the large
size rather than full
if mediaSizeSlug
isn't set.
Can you also update the PR test instructions to cover this aspect of the PR's changes?
// Try the "large" size URL, falling back to the "full" size URL below. | ||
src = | ||
media.sizes?.large?.url || | ||
// eslint-disable-next-line camelcase | ||
media.media_details?.sizes?.large?.source_url; | ||
media.sizes?.[ mediaSizeSlug ]?.url || | ||
media?.media_details?.sizes?.[ mediaSizeSlug ]?.source_url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code no longer matches the inline comment above.
I assume the intent of this change is so that any specified mediaSizeSlug
is used however now it won't prefer large instead of full as the unchanged comment suggests.
…nt/resolution-option-for-featured-image-media-text-block
What?
Resolution size support for the featured image is missing in the media text block.
Why?
When the featured image is used in media text block, the
ResolutionTool
is not currently available.How?
This PR implement
ResolutionTool
support for featured image. Along with that, cleaning up some issues/bugs that was already present trunk and discovered while working on this PR.Following are the fixes,
Use Featured Image
on click of theReset
option in the toolbarUse Featured Image
option on selection.Testing Instructions
Use Featured Image
option from toolbar of Media-Text blockResolution
dropdown in Media-Text block controlslarge
tofull
ifmediaSizeSlug
isn't available, as default resolution option isfull
.Screenshots or screencast
Edit-Post-.Hello-world-.-.-gutenberg-.-WordPress.4.webm