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

Post Featured Image block: Alt text from media library is not returned #40999

Closed
luminuu opened this issue May 11, 2022 · 2 comments · Fixed by #41775
Closed

Post Featured Image block: Alt text from media library is not returned #40999

luminuu opened this issue May 11, 2022 · 2 comments · Fixed by #41775
Assignees
Labels
[Block] Post Featured Image Affects the Post Featured Image Block

Comments

@luminuu
Copy link
Member

luminuu commented May 11, 2022

Description

When selecting a featured image from the media library, you can add an alt text for the given image. However on the frontend, only the name of the post or page is returned in the alt text of the featured image, instead of the saved alt text from the media library.

Step-by-step reproduction instructions

  1. Make sure to have a block theme active.
  2. Go to a post or page where you have a featured image, or create a new post or page and add a featured image.
  3. Make sure you have set an alt text when selecting the featured image from the media library.
  4. Save the post or page.
  5. Go to the frontend and check the alt text of the featured image. It should contain the post or page title instead of the alt text from the media library.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.0 RC2
  • Gutenberg plugin 13.1.0
  • Wabi Theme, but same behaviour on Twenty Twenty-Two

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added the [Block] Post Featured Image Affects the Post Featured Image Block label May 11, 2022
@carolinan
Copy link
Contributor

carolinan commented May 12, 2022

I believe the alt text is only intended to be the post or page title if the image is linked. I was able to confirm that it is used when the image is not linked. @aristath
#39634

@aristath
Copy link
Member

Thank you for reporting this @luminuu, and for bringing it to my attention @carolinan.
This was introduced in #39634, and a PR that fixes this can be found in #41775. 👍

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Featured Image Affects the Post Featured Image Block
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants