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: Only get the post title when rendering alt text #45835

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

Mamaduka
Copy link
Member

What?

PR updates logic in Featured Image render callback to only call get_the_title when the value is used.

Why?

It's a small code quality improvement.

Testing Instructions

  1. Open a Post or Page.
  2. Insert a Post Featured Image block.
  3. Enabled "Link to post" settings.
  4. Confirm that the image alt is set to a post title.

@Mamaduka Mamaduka requested a review from ajitbohra as a code owner November 17, 2022 06:04
@codesandbox
Copy link

codesandbox bot commented Nov 17, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@Mamaduka Mamaduka requested review from ntsekouras and aristath and removed request for ajitbohra November 17, 2022 06:04
@Mamaduka Mamaduka self-assigned this Nov 17, 2022
@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Block] Post Featured Image Affects the Post Featured Image Block labels Nov 17, 2022
@Mamaduka
Copy link
Member Author

Thank you, @carolinan!

@Mamaduka Mamaduka merged commit fecc1d2 into trunk Nov 17, 2022
@Mamaduka Mamaduka deleted the update/featured-image-get-title branch November 17, 2022 07:28
@github-actions github-actions bot added this to the Gutenberg 14.7 milestone Nov 17, 2022
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 [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants