-
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: Hide the alt text option for featured images #60496
Media & Text: Hide the alt text option for featured images #60496
Conversation
Hides the TextareaControl for the alternative text if the block uses a featured image. Adds the alt attribute to the image tag on the front.
Size Change: +1.95 kB (0%) Total Size: 1.73 MB
ℹ️ View Unchanged
|
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. |
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Flaky tests detected in 995f864. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8609560868
|
Replace featuredImageURL with useFeaturedImage
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.
LGTM 🚀
What?
Hides the TextareaControl for the alternative text if the block uses a featured image.
Adds the alt attribute to the img tag on the front.
Closes #60023
Why?
The alt text option does not work correctly in the editor, it is problematic inside query loops, and the alt text is not output on the front. Please see the discussion in the linked issue.
How?
The PR:
Testing Instructions
With Gutenberg trunk:
Add three media & text blocks:
One with a video, one with a standard image, and one with a featured image. The featured image should not have an alt text in the media library.
Save.
Apply the PR.
Refresh the post and confirm that the PR does not cause any block validation errors with the existing blocks.
Select the media & text block that has the standard image. Confirm that the alternative text option shows in the block settings panel.
Select the media & text block that has the featured image. Confirm that the alternative text option does not show.
Confirm that the block with the featured image has an empty alt attribute in the editor and the front.
Return to the editor, open the media library and add an alt text to the featured image.
Confirm that the block with the featured image uses the correct text in the alt attribute in the editor and the front.