Taxonomies: warn when editing an existing taxonomy's slug#77527
Conversation
Shows a warning Notice under the Slug input in the Edit modal when the user changes the slug of an existing taxonomy, flagging that renaming the key can make existing terms inaccessible until a migration runs. The warning only appears in the Edit flow and only once the value differs from the stored slug; Add and the list view are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in b68edd2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24733332961
|
ntsekouras
left a comment
There was a problem hiding this comment.
For the experiment this looks good. I've left a comment to discuss whether we could augment DataViews API.
| description: ( | ||
| <Stack direction="column" gap="sm"> | ||
| { showRenameWarning && ( | ||
| <Notice status="warning" isDismissible={ false }> |
There was a problem hiding this comment.
That could be something to consider baking into DataVews API. Maybe an overload of description to also pass the item and field where field.getValue could be used, similar to render?
@oandregal what do you think?
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |

What?
Follow-up to #77497. Adds a warning Notice under the Slug field in the Edit Taxonomy modal (Settings > Taxonomies > Edit) when the user changes the slug of an existing custom taxonomy.
Why?
The taxonomy slug is effectively its identity key — it's what
register_taxonomy()is called with and what terms reference in the database. If a user edits an existing taxonomy's slug, existing terms can become inaccessible until a migration renames them. Previously, this caveat was buried in the field's always-on description next to the formatting rules; users creating new taxonomies were reading irrelevant scary text, and users editing existing ones could miss it. This PR scopes the warning to the only flow where it matters, and surfaces it as a proper warning Notice.How?
Displays a warning if the user attempts to edit the slug of an existing custom taxonomy.
Testing Instructions
Slug field.
them.
Testing Instructions for Keyboard
Same
Screenshots or screencast
Before:

After - before editing slug

After - after editing slug

Use of AI Tools
Opus 4.7