Enhance Term Description Block with Context Support #71525
+131
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
The
term-description
block, as opposed to thepost-title
or thequery-title
, always showed a placeholder, even when the data was technically available (e.g. if the user was modifying a specific category template).This PR fixes that by allowing the
term-description
block to either receive context from a parent (like thepost-title
), or fallback to the parsing of the template slug (like thequery-title
).Why?
Not showing the actual content is not only a degraded user experience (as the user can't preview the template correctly without displaying the actual description), but also inconsistent with the behavior of other blocks.
How?
The PR basically implements already available patterns from
post-title
andquery-title
. This allows the block to be quite versatile and reusable in different contexts.Testing Instructions
Preserving original functionality
term-description
block.New functionality
term-description
block.