diff --git a/routes/taxonomies/fields.tsx b/routes/taxonomies/fields.tsx index b9b398134c15ea..6c8d38ea1cfca3 100644 --- a/routes/taxonomies/fields.tsx +++ b/routes/taxonomies/fields.tsx @@ -1,13 +1,13 @@ /** * WordPress dependencies */ -import { Notice } from '@wordpress/components'; import { store as coreStore } from '@wordpress/core-data'; import { resolveSelect, useSelect } from '@wordpress/data'; import { useMemo } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import type { Field, Form } from '@wordpress/dataviews'; -import { Stack } from '@wordpress/ui'; +// eslint-disable-next-line @wordpress/use-recommended-components -- Used here because it supports rendering as a `span` via the `render` prop to avoid invalid HTML. +import { Notice, Stack } from '@wordpress/ui'; /** * Internal dependencies @@ -114,13 +114,15 @@ export function useSlugField( type: 'text', enableGlobalSearch: true, description: ( - + }> { showRenameWarning && ( - - { __( - 'Changing the key renames the taxonomy — existing terms may become inaccessible until a migration updates the database.' - ) } - + }> + + { __( + 'Changing the key renames the taxonomy — existing terms may become inaccessible until a migration updates the database.' + ) } + + ) } { __( @@ -131,7 +133,7 @@ export function useSlugField( ), isValid: { required: true, - pattern: '^[a-z0-9_-]{1,32}$', + pattern: '^[a-z0-9_\\-]{1,32}$', custom: async ( value: TaxonomyFormData ) => { const slug = value.slug; if ( originalSlug !== undefined && slug === originalSlug ) {