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 ! |
afercia
left a comment
There was a problem hiding this comment.
Thanks @prajapatisagar LGTM.
* Add featured image alt text * Updated duplicate code to function. * Modify doc * Minor adjustments for the docblock. --------- Co-authored-by: prajapatisagar <sagarprajapati@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org>
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