-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
#57893 Add 'Use empty alt text' option for Post Featured Image block #68569
base: trunk
Are you sure you want to change the base?
#57893 Add 'Use empty alt text' option for Post Featured Image block #68569
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 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. |
<ToggleControl | ||
__nextHasNoMarginBottom | ||
label={ __( | ||
'Use empty alt text (decorative image)' |
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.
I think this text is too long and that the parentheses should be removed.
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.
Done
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.
Thank you for working on this.
I want to make the following change request:
The alt text should also be removed from the block in the editor when the option is enabled.
The failing test needs to be solved, the test fixtures need to be regenerated. Try npm run fixtures:regenerate
Hi @carolinan I have updated the label and also tried to resolve the test using |
To be honest, I struggle a bit with this feature here 🤔 The issue that worries me is that the featured image block is almost never used in isolation on a single post. Instead the block gets used on single templates and inside query loops. So in both of these scenarios we are not talking about a single featured image for a specific block but rather the generalized concept of a featured image inside a template. Any setting you apply to the featured image block will be applied to all posts / all featured images. Knowing that I'm a little worried that the feature will get enabled by folks who want to set it for a single image only. But in doing so they have now removed the alt text from all featured images everywhere. |
Fixes #57893
What?
Adds the ability to set empty alt text (alt="") for decorative images in the Post Featured Image block by introducing a new toggle control in the block settings.
Why?
Currently, there is no way to set empty alt text (alt="") for the Featured Image block when the image is purely decorative. While it's possible to remove alt text in the media library, this is a global solution that affects the image everywhere it's used. This enhancement allows setting empty alt text specifically for the Featured Image block context, improving accessibility by properly indicating decorative images to screen readers.
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
screen-capture.3.mp4