-
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
Add featured image alt text #66189
Add featured image alt text #66189
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. |
Thanks @prajapatisagar ! |
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 @prajapatisagar LGTM.
* Add featured image alt text * Updated duplicate code to function. * Modify doc * Minor adjustments for the docblock. --------- Co-authored-by: prajapatisagar <[email protected]> Co-authored-by: afercia <[email protected]>
Addresses part of #66005
What?
This PR ensures that when an image fails to load (i.e., is broken), the alt text is displayed in its place. If alt text is not provided, the image name will be displayed instead.
Why?
This update improves accessibility and enhances user experience by providing context when an image fails to load. Instead of leaving a blank space or displaying a broken image icon, the alt text or image name will be shown, offering users helpful information.
How?
The implementation involves updating the image rendering logic to check if the image fails to load. If it does, the alt text (if available) will be displayed. If the alt text is not provided, the image name will be used as a fallback display.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast