Skip to content

Fix: Term Description block skips display filters inside Terms Query. - #81290

Open
jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:fix/term-description-terms-query-display-filters
Open

Fix: Term Description block skips display filters inside Terms Query.#81290
jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:fix/term-description-terms-query-display-filters

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Aug 6, 2026

Copy link
Copy Markdown
Member

When the Term Description block renders inside a Terms Query loop, it outputs the raw $term->description value, skipping the term_description display filters. Multi-paragraph descriptions lose their paragraph tags and collapse into a single run of text, and any formatting plugins add through the filters is ignored. The same block on a taxonomy archive template renders correctly, because that path goes through term_description().

This PR fixes the issue by retrieving the value with get_term_field( 'description', $term ), which applies the same display filters as the archive path, so both contexts render identically.

Before

Term descriptions rendered inside a Terms Query loop without the display filters: the two paragraphs of each description collapse into a single run of text

After

Term descriptions rendered inside a Terms Query loop with the display filters applied: each description keeps its two paragraphs

Testing Instructions

  1. Create a category and give it a description with two paragraphs.
  2. Add a Terms Query block to a page and keep a Term Description block inside the Term Template.
  3. View the page on the front end and verify the description keeps its paragraphs, matching how it renders on the category archive.

AI usage disclosure: fix and description drafted with AI assistance and reviewed by me.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

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: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>

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

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Block] Term Description Affects the Term Description Block - used for displaying the description of a tag, catergory or othe labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Term Description Affects the Term Description Block - used for displaying the description of a tag, catergory or othe [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant