Skip to content

Fix: Tag Cloud: Keep the taxonomy and the post counts setting when transforming to or from Terms List - #86962

Merged
hbhalodia merged 3 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-86960
Nov 17, 2026
Merged

hbhalodia merged 3 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-86960

Conversation

@hbhalodia

Copy link
Copy Markdown
Contributor

What?

Closes #86960

Keeps the selected taxonomy and the post counts setting when a block is transformed between Tag Cloud and Terms List, in both directions.

Why?

Both transforms created the new block with default attributes. A Categories List transformed to Tag Cloud showed tags, a Tag Cloud transformed to Terms List showed categories, and the counts option was turned off either way. The transforms were added in #38566, before #65272 gave the Terms List block a taxonomy attribute, and were never updated.

How?

Each transform now passes the source block's settings to createBlock():

  • taxonomy is passed as is, since both blocks store it as a taxonomy slug.
  • showPostCounts (Terms List) and showTagCounts (Tag Cloud) are mapped to each other.

Settings with no counterpart in the other block (number of tags, font sizes, dropdown, hierarchy, empty terms) keep their defaults. Colors, class names and other block supports were already carried over by the block editor.

Testing Instructions

  1. Follow the reproduction steps in Tag Cloud: Transforming to or from Terms List loses the taxonomy and the post counts setting #86960.
  2. Categories List → Tag Cloud: the cloud shows "Uncategorized (1)", Taxonomy is "Categories", and Show tag counts is on.
  3. Tag Cloud → Terms List: the list shows "alpha (1)" and "beta (1)", the block is named "Terms List", Taxonomy is "Tags", and Show post counts is on.
  4. Transform either block back. It returns with the same taxonomy and counts setting.

Testing Instructions for Keyboard

  • None

Screenshots or screencast

Screen.Recording.2026-11-17.at.6.45.39.PM.mov

Use of AI Tools

Claude Code (Claude Opus 5.5) was used to trace the cause and draft the fix and this description. I reproduced the bug and reviewed all changes.

🤖 Generated with Claude Code

@hbhalodia
hbhalodia requested a balanced review from Copilot November 17, 2026 13:18
@hbhalodia hbhalodia self-assigned this Nov 17, 2026
@hbhalodia hbhalodia added [Type] Bug An existing feature does not function as intended [Feature] Block Transforms Block transforms from one block to another [Package] Block library /packages/block-library [Block] Tag Cloud Affects the Tag Cloud Block labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

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: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change intended to preserve settings between Tag Cloud and Terms List transforms.

No open issues 🎉

What changed in this PR

Preserves taxonomy and post-count settings when transforming between Tag Cloud and Terms List, fixing the settings loss described in #86960.

Changes:

  • Passes the taxonomy through both transforms and maps showPostCounts to and from showTagCounts.
  • Adds a changelog entry for the fix.
File Description
packages/​block-library/​src/​tag-cloud/​transforms.js Preserves taxonomy and count settings in both transform directions.
packages/​block-library/​CHANGELOG.md Documents the transform fix.

Review effort: Balanced

@hbhalodia
hbhalodia marked this pull request as ready for review November 17, 2026 13:21

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch and clean fix. Thanks, @hbhalodia!

@hbhalodia hbhalodia added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Nov 17, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Nov 17, 2026
@hbhalodia
hbhalodia enabled auto-merge (squash) November 17, 2026 13:33
@hbhalodia
hbhalodia merged commit 8da9a65 into WordPress:trunk Nov 17, 2026
110 checks passed
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 17, 2026
@hbhalodia
hbhalodia deleted the fix/issue-86960 branch November 17, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Tag Cloud Affects the Tag Cloud Block [Feature] Block Transforms Block transforms from one block to another [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.

Tag Cloud: Transforming to or from Terms List loses the taxonomy and the post counts setting

3 participants