Skip to content
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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

prajapatisagar
Copy link
Contributor

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

Alt Text 1
Alt Text 2

Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: prajapatisagar <sagarprajapati@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@akasunil akasunil added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Editor /packages/editor labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants