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 Terms: Remove unnecessary 'get_the_terms' call #65867

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Oct 4, 2024

What?

PR updates the Post Terms render callback and removes unnecessary get_the_terms call.

Why?

The post terms are retrieved, but values are never used for rendering. The get_the_term_list handles the markup and internally calls the get_the_terms function.

Testing Instructions

  1. Open a post or page.
  2. Insert a Post Term block - Tags or Categories.
  3. Preview the post. Confirm it renders nothing.
  4. Assign a term to a post and preview it again.
  5. Confirm the correct term list is rendered.

Testing Instructions for Keyboard

Same.

Screenshots or screencast

CleanShot 2024-10-04 at 05 44 27

@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Block] Post Terms Affects the Post Terms Block labels Oct 4, 2024
@Mamaduka Mamaduka self-assigned this Oct 4, 2024
@Mamaduka Mamaduka requested a review from ajitbohra as a code owner October 4, 2024 01:53
@Mamaduka Mamaduka removed the request for review from ajitbohra October 4, 2024 01:53
Copy link

github-actions bot commented Oct 4, 2024

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: Mamaduka <[email protected]>
Co-authored-by: aristath <[email protected]>

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

Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Mamaduka
Copy link
Member Author

Mamaduka commented Oct 4, 2024

Thank you, @aristath!

@Mamaduka Mamaduka merged commit 75c2147 into trunk Oct 4, 2024
71 checks passed
@Mamaduka Mamaduka deleted the optimize/post-terms-get-the-terms-calls branch October 4, 2024 05:19
@github-actions github-actions bot added this to the Gutenberg 19.5 milestone Oct 4, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Terms Affects the Post Terms 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