From 75c3aed738006fe6c44238ff9f4022b960f9f3f0 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 12:23:17 +0100 Subject: [PATCH 01/23] Add initial block --- docs/reference-guides/core-blocks.md | 9 ++ lib/blocks.php | 1 + packages/block-library/src/index.js | 2 + .../block-library/src/term-name/block.json | 68 +++++++++ packages/block-library/src/term-name/edit.js | 137 ++++++++++++++++++ packages/block-library/src/term-name/index.js | 21 +++ .../block-library/src/term-name/index.php | 71 +++++++++ 7 files changed, 309 insertions(+) create mode 100644 packages/block-library/src/term-name/block.json create mode 100644 packages/block-library/src/term-name/edit.js create mode 100644 packages/block-library/src/term-name/index.js create mode 100644 packages/block-library/src/term-name/index.php diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index aaa0a9e56eff3e..56f274beccd81e 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -991,6 +991,15 @@ Display the description of categories, tags and custom taxonomies when viewing a - **Supports:** align (full, wide), color (background, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign +## Term Name + +Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/term-name)) + +- **Name:** core/term-name +- **Category:** theme +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Attributes:** isLink, linkTarget, textAlign + ## Term Template Contains the block elements used to render a taxonomy term, like the name, description, and more. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/term-template)) diff --git a/lib/blocks.php b/lib/blocks.php index 3a980b22fd5442..236011b03abd0c 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -125,6 +125,7 @@ function gutenberg_reregister_core_block_types() { 'tag-cloud.php' => 'core/tag-cloud', 'template-part.php' => 'core/template-part', 'term-description.php' => 'core/term-description', + 'term-name.php' => 'core/term-name', 'terms-query.php' => 'core/terms-query', 'term-template.php' => 'core/term-template', 'video.php' => 'core/video', diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 590e3da0330882..1ed3fb42f0e3b6 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -129,6 +129,7 @@ import * as tableOfContents from './table-of-contents'; import * as tagCloud from './tag-cloud'; import * as templatePart from './template-part'; import * as termDescription from './term-description'; +import * as termName from './term-name'; import * as termsQuery from './terms-query'; import * as termTemplate from './term-template'; import * as textColumns from './text-columns'; @@ -257,6 +258,7 @@ const getAllBlocks = () => { if ( window?.__experimentalEnableBlockExperiments ) { blocks.push( termsQuery ); blocks.push( termTemplate ); + blocks.push( termName ); } if ( window?.__experimentalEnableFormBlocks ) { diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json new file mode 100644 index 00000000000000..cbe39028346765 --- /dev/null +++ b/packages/block-library/src/term-name/block.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/term-name", + "title": "Term Name", + "category": "theme", + "description": "Displays the name of a taxonomy term.", + "textdomain": "default", + "usesContext": [ "termId", "taxonomy" ], + "attributes": { + "textAlign": { + "type": "string" + }, + "isLink": { + "type": "boolean", + "default": false + }, + "linkTarget": { + "type": "string", + "default": "_self" + } + }, + "supports": { + "align": [ "wide", "full" ], + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "spacing": { + "margin": true, + "padding": true + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, + "interactivity": { + "clientNavigation": true + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "radius": true, + "color": true, + "width": true, + "style": true + } + } + } +} diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js new file mode 100644 index 00000000000000..0b8bab48e9a7dd --- /dev/null +++ b/packages/block-library/src/term-name/edit.js @@ -0,0 +1,137 @@ +/** + * External dependencies + */ +import clsx from 'clsx'; + +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { + useBlockProps, + BlockControls, + AlignmentControl, + InspectorControls, +} from '@wordpress/block-editor'; +import { + ToggleControl, + TextControl, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem, +} from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; + +/** + * Internal dependencies + */ +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; + +export default function TermNameEdit( { + attributes, + setAttributes, + context: { termId, taxonomy }, +} ) { + const { textAlign, isLink, linkTarget } = attributes; + + const term = useSelect( + ( select ) => { + if ( ! termId || ! taxonomy ) { + return null; + } + return select( coreStore ).getEntityRecord( + 'taxonomy', + taxonomy, + termId + ); + }, + [ termId, taxonomy ] + ); + + const termName = term?.name || __( 'Term Name' ); + + const blockProps = useBlockProps( { + className: clsx( { + [ `has-text-align-${ textAlign }` ]: textAlign, + } ), + } ); + + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + + let termNameDisplay = termName; + if ( isLink && term ) { + const termLink = term.link || '#'; + termNameDisplay = ( + e.preventDefault() } + > + { termName } + + ); + } + + return ( + <> + + { + setAttributes( { textAlign: nextAlign } ); + } } + /> + + + { + setAttributes( { + isLink: false, + linkTarget: '_self', + } ); + } } + dropdownMenuProps={ dropdownMenuProps } + > + !! isLink } + label={ __( 'Make term name a link' ) } + onDeselect={ () => setAttributes( { isLink: false } ) } + isShownByDefault + > + + setAttributes( { isLink: ! isLink } ) + } + checked={ isLink } + /> + + { isLink && ( + linkTarget !== '_self' } + label={ __( 'Link target' ) } + onDeselect={ () => + setAttributes( { linkTarget: '_self' } ) + } + > + + setAttributes( { + linkTarget: newLinkTarget, + } ) + } + /> + + ) } + + +
{ termNameDisplay }
+ + ); +} diff --git a/packages/block-library/src/term-name/index.js b/packages/block-library/src/term-name/index.js new file mode 100644 index 00000000000000..161f1385475abe --- /dev/null +++ b/packages/block-library/src/term-name/index.js @@ -0,0 +1,21 @@ +/** + * WordPress dependencies + */ +import { tag as icon } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import initBlock from '../utils/init-block'; +import metadata from './block.json'; +import edit from './edit'; + +const { name } = metadata; +export { metadata, name }; + +export const settings = { + icon, + edit, +}; + +export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php new file mode 100644 index 00000000000000..6538f680f1b74e --- /dev/null +++ b/packages/block-library/src/term-name/index.php @@ -0,0 +1,71 @@ +context, $block->parsed_block, null ); + + if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { + $term = get_term( $context['termId'], $context['taxonomy'] ); + if ( $term && ! is_wp_error( $term ) ) { + $term_name = $term->name; + } + } + + if ( empty( $term_name ) ) { + return ''; + } + + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { + $term_link = get_term_link( $context['termId'], $context['taxonomy'] ); + if ( ! is_wp_error( $term_link ) ) { + $term_name = sprintf( + '%3$s', + esc_url( $term_link ), + esc_attr( $attributes['linkTarget'] ), + $term_name + ); + } + } + + $classes = array(); + if ( isset( $attributes['textAlign'] ) ) { + $classes[] = 'has-text-align-' . $attributes['textAlign']; + } + if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { + $classes[] = 'has-link-color'; + } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); + + return sprintf( + '
%s
', + $wrapper_attributes, + $term_name + ); +} + +/** + * Registers the `core/term-name` block on the server. + */ +function register_block_core_term_name() { + register_block_type_from_metadata( + __DIR__ . '/term-name', + array( + 'render_callback' => 'render_block_core_term_name', + ) + ); +} +add_action( 'init', 'register_block_core_term_name' ); From 324f6fc14634929bf4f7e819d64de352e90532c1 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 12:55:01 +0100 Subject: [PATCH 02/23] Add tagName attribute --- docs/reference-guides/core-blocks.md | 2 +- .../block-library/src/term-name/block.json | 8 +-- packages/block-library/src/term-name/edit.js | 63 ++++++++++--------- .../block-library/src/term-name/index.php | 8 ++- 4 files changed, 43 insertions(+), 38 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 56f274beccd81e..4bd380d919106a 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -998,7 +998,7 @@ Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gut - **Name:** core/term-name - **Category:** theme - **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** isLink, linkTarget, textAlign +- **Attributes:** isLink, tagName, textAlign ## Term Template diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index cbe39028346765..8a9afaf22bc89f 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -11,13 +11,13 @@ "textAlign": { "type": "string" }, + "tagName": { + "type": "string", + "default": "div" + }, "isLink": { "type": "boolean", "default": false - }, - "linkTarget": { - "type": "string", - "default": "_self" } }, "supports": { diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index 0b8bab48e9a7dd..98ab0d270b9906 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -15,7 +15,7 @@ import { } from '@wordpress/block-editor'; import { ToggleControl, - TextControl, + SelectControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, } from '@wordpress/components'; @@ -32,7 +32,7 @@ export default function TermNameEdit( { setAttributes, context: { termId, taxonomy }, } ) { - const { textAlign, isLink, linkTarget } = attributes; + const { textAlign, tagName = 'div', isLink } = attributes; const term = useSelect( ( select ) => { @@ -58,15 +58,13 @@ export default function TermNameEdit( { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + const TagName = tagName; + let termNameDisplay = termName; if ( isLink && term ) { const termLink = term.link || '#'; termNameDisplay = ( - e.preventDefault() } - > + e.preventDefault() }> { termName } ); @@ -87,12 +85,38 @@ export default function TermNameEdit( { label={ __( 'Settings' ) } resetAll={ () => { setAttributes( { + tagName: 'div', isLink: false, - linkTarget: '_self', } ); } } dropdownMenuProps={ dropdownMenuProps } > + tagName !== 'div' } + label={ __( 'HTML element' ) } + onDeselect={ () => setAttributes( { tagName: 'div' } ) } + isShownByDefault + > + + setAttributes( { tagName: value } ) + } + /> + !! isLink } label={ __( 'Make term name a link' ) } @@ -108,30 +132,9 @@ export default function TermNameEdit( { checked={ isLink } /> - { isLink && ( - linkTarget !== '_self' } - label={ __( 'Link target' ) } - onDeselect={ () => - setAttributes( { linkTarget: '_self' } ) - } - > - - setAttributes( { - linkTarget: newLinkTarget, - } ) - } - /> - - ) } -
{ termNameDisplay }
+ { termNameDisplay } ); } diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 6538f680f1b74e..7c9d565e67005b 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -29,13 +29,14 @@ function render_block_core_term_name( $attributes, $content, $block ) { return ''; } + $tag_name = isset( $attributes['tagName'] ) ? $attributes['tagName'] : 'div'; + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $term_link = get_term_link( $context['termId'], $context['taxonomy'] ); if ( ! is_wp_error( $term_link ) ) { $term_name = sprintf( - '%3$s', + '%2$s', esc_url( $term_link ), - esc_attr( $attributes['linkTarget'] ), $term_name ); } @@ -51,7 +52,8 @@ function render_block_core_term_name( $attributes, $content, $block ) { $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); return sprintf( - '
%s
', + '<%1$s %2$s>%3$s', + $tag_name, $wrapper_attributes, $term_name ); From c3549bc8e7c776d12aee9b3886d150adc2c46d38 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 13:03:13 +0100 Subject: [PATCH 03/23] Fix phpcs --- packages/block-library/src/term-name/index.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 7c9d565e67005b..c2195871f15586 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -8,6 +8,8 @@ /** * Renders the `core/term-name` block on the server. * + * @since 6.9.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -16,7 +18,17 @@ */ function render_block_core_term_name( $attributes, $content, $block ) { $term_name = ''; - $context = apply_filters( 'render_block_context', $block->context, $block->parsed_block, null ); + + /** + * Filters the block context to get the current term ID and taxonomy. + * + * @since 6.9.0 + * + * @param array $context The block context. + * @param array $parsed_block The parsed block. + * @param WP_Block|null $parent_block The parent block. + */ + $context = apply_filters( 'render_block_context', $block->context, $block->parsed_block, null ); if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { $term = get_term( $context['termId'], $context['taxonomy'] ); @@ -61,6 +73,8 @@ function render_block_core_term_name( $attributes, $content, $block ) { /** * Registers the `core/term-name` block on the server. + * + * @since 6.9.0 */ function register_block_core_term_name() { register_block_type_from_metadata( From dda7d426cfdf9385676d7010a324e8324fe5df4f Mon Sep 17 00:00:00 2001 From: Sarah Norris <1645628+mikachan@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:01:07 +0100 Subject: [PATCH 04/23] Update packages/block-library/src/term-name/block.json Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- packages/block-library/src/term-name/block.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index 8a9afaf22bc89f..20d11e791f7d57 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -1,6 +1,7 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, + "__experimental": true, "name": "core/term-name", "title": "Term Name", "category": "theme", From ffdefaa6067297adbfa9c27aa08c233c62e00287 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 16:10:13 +0100 Subject: [PATCH 05/23] Add border-box --- packages/block-library/src/term-name/block.json | 3 ++- packages/block-library/src/term-name/style.scss | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 packages/block-library/src/term-name/style.scss diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index 20d11e791f7d57..d7f61f5ce9c8d8 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -65,5 +65,6 @@ "style": true } } - } + }, + "style": "wp-block-term-name" } diff --git a/packages/block-library/src/term-name/style.scss b/packages/block-library/src/term-name/style.scss new file mode 100644 index 00000000000000..b3e068055cd326 --- /dev/null +++ b/packages/block-library/src/term-name/style.scss @@ -0,0 +1,4 @@ +.wp-block-term-name { + // This block has customizable padding, border-box makes that more predictable. + box-sizing: border-box; +} From 4ffb9014841e22648d61c836939150767e843c31 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 16:18:52 +0100 Subject: [PATCH 06/23] Remove term from isLink render logic --- docs/reference-guides/core-blocks.md | 1 + packages/block-library/src/term-name/edit.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 4bd380d919106a..deecd3bcc820ad 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -996,6 +996,7 @@ Display the description of categories, tags and custom taxonomies when viewing a Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/term-name)) - **Name:** core/term-name +- **Experimental:** true - **Category:** theme - **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, tagName, textAlign diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index 98ab0d270b9906..df311d99f9a430 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -61,8 +61,8 @@ export default function TermNameEdit( { const TagName = tagName; let termNameDisplay = termName; - if ( isLink && term ) { - const termLink = term.link || '#'; + if ( isLink ) { + const termLink = term?.link || '#'; termNameDisplay = ( e.preventDefault() }> { termName } From 7817e35208863b64e3ef8c4c9b2263fe34bb2c91 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 7 Oct 2025 16:28:11 +0100 Subject: [PATCH 07/23] Update HTML element selector --- packages/block-library/src/term-name/edit.js | 53 +++++++++----------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index df311d99f9a430..b9ccff672c5566 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -12,10 +12,10 @@ import { BlockControls, AlignmentControl, InspectorControls, + privateApis as blockEditorPrivateApis, } from '@wordpress/block-editor'; import { ToggleControl, - SelectControl, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, } from '@wordpress/components'; @@ -26,6 +26,9 @@ import { store as coreStore } from '@wordpress/core-data'; * Internal dependencies */ import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; +import { unlock } from '../lock-unlock'; + +const { HTMLElementControl } = unlock( blockEditorPrivateApis ); export default function TermNameEdit( { attributes, @@ -80,43 +83,37 @@ export default function TermNameEdit( { } } /> + + + setAttributes( { tagName: value } ) + } + /> + { setAttributes( { - tagName: 'div', isLink: false, } ); } } dropdownMenuProps={ dropdownMenuProps } > - tagName !== 'div' } - label={ __( 'HTML element' ) } - onDeselect={ () => setAttributes( { tagName: 'div' } ) } - isShownByDefault - > - - setAttributes( { tagName: value } ) - } - /> - !! isLink } label={ __( 'Make term name a link' ) } From 13190801fab4b7b97e79a480662c11ea9ba2a19e Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 8 Oct 2025 10:44:42 +0100 Subject: [PATCH 08/23] Switch to HeadingLevelDropdown --- .../block-library/src/term-name/block.json | 2 +- packages/block-library/src/term-name/edit.js | 41 +++++++------------ .../block-library/src/term-name/index.php | 2 +- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index d7f61f5ce9c8d8..72bea5d11dda4c 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -14,7 +14,7 @@ }, "tagName": { "type": "string", - "default": "div" + "default": "p" }, "isLink": { "type": "boolean", diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index b9ccff672c5566..a5c5429e141547 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -12,7 +12,7 @@ import { BlockControls, AlignmentControl, InspectorControls, - privateApis as blockEditorPrivateApis, + HeadingLevelDropdown, } from '@wordpress/block-editor'; import { ToggleControl, @@ -26,16 +26,13 @@ import { store as coreStore } from '@wordpress/core-data'; * Internal dependencies */ import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; -import { unlock } from '../lock-unlock'; - -const { HTMLElementControl } = unlock( blockEditorPrivateApis ); export default function TermNameEdit( { attributes, setAttributes, context: { termId, taxonomy }, } ) { - const { textAlign, tagName = 'div', isLink } = attributes; + const { textAlign, tagName = 'p', isLink } = attributes; const term = useSelect( ( select ) => { @@ -76,6 +73,19 @@ export default function TermNameEdit( { return ( <> + { + setAttributes( { + tagName: newLevel === 0 ? 'p' : `h${ newLevel }`, + } ); + } } + /> { @@ -83,27 +93,6 @@ export default function TermNameEdit( { } } /> - - - setAttributes( { tagName: value } ) - } - /> - Date: Wed, 8 Oct 2025 10:53:32 +0100 Subject: [PATCH 09/23] Remove border radius and margin controls --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/term-name/block.json | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index deecd3bcc820ad..aec8754b42e0bc 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -998,7 +998,7 @@ Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gut - **Name:** core/term-name - **Experimental:** true - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, tagName, textAlign ## Term Template diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index 72bea5d11dda4c..fad08cc38865c7 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -34,7 +34,6 @@ } }, "spacing": { - "margin": true, "padding": true }, "typography": { @@ -59,7 +58,6 @@ "width": true, "style": true, "__experimentalDefaultControls": { - "radius": true, "color": true, "width": true, "style": true From e8fb069e74a9e44794a60760b66097fd0f1f4c4f Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 8 Oct 2025 11:14:24 +0100 Subject: [PATCH 10/23] Use pseudo link --- packages/block-library/src/term-name/edit.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index a5c5429e141547..c59e23c6de0464 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -62,9 +62,11 @@ export default function TermNameEdit( { let termNameDisplay = termName; if ( isLink ) { - const termLink = term?.link || '#'; termNameDisplay = ( - e.preventDefault() }> + e.preventDefault() } + > { termName } ); From 78a1946b4e4f043e18776d63e7694ffdbf252573 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 8 Oct 2025 11:38:53 +0100 Subject: [PATCH 11/23] Allow block to be used outside of terms query --- packages/block-library/src/term-name/edit.js | 18 +-- .../block-library/src/term-name/index.php | 13 ++- .../src/term-name/use-term-name.js | 106 ++++++++++++++++++ 3 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 packages/block-library/src/term-name/use-term-name.js diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index c59e23c6de0464..134b3c6a32910f 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -19,13 +19,12 @@ import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, } from '@wordpress/components'; -import { useSelect } from '@wordpress/data'; -import { store as coreStore } from '@wordpress/core-data'; /** * Internal dependencies */ import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; +import { useTermName } from './use-term-name'; export default function TermNameEdit( { attributes, @@ -33,20 +32,7 @@ export default function TermNameEdit( { context: { termId, taxonomy }, } ) { const { textAlign, tagName = 'p', isLink } = attributes; - - const term = useSelect( - ( select ) => { - if ( ! termId || ! taxonomy ) { - return null; - } - return select( coreStore ).getEntityRecord( - 'taxonomy', - taxonomy, - termId - ); - }, - [ termId, taxonomy ] - ); + const { term } = useTermName( termId, taxonomy ); const termName = term?.name || __( 'Term Name' ); diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 63371d479459e8..edbeac277ebb19 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -32,19 +32,22 @@ function render_block_core_term_name( $attributes, $content, $block ) { if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { $term = get_term( $context['termId'], $context['taxonomy'] ); - if ( $term && ! is_wp_error( $term ) ) { - $term_name = $term->name; + } else { + $term = get_queried_object(); + if ( ! $term instanceof WP_Term ) { + $term = null; } } - if ( empty( $term_name ) ) { + if ( ! $term || is_wp_error( $term ) ) { return ''; } - $tag_name = isset( $attributes['tagName'] ) ? $attributes['tagName'] : 'p'; + $term_name = $term->name; + $tag_name = isset( $attributes['tagName'] ) ? $attributes['tagName'] : 'p'; if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { - $term_link = get_term_link( $context['termId'], $context['taxonomy'] ); + $term_link = get_term_link( $term ); if ( ! is_wp_error( $term_link ) ) { $term_name = sprintf( '%2$s', diff --git a/packages/block-library/src/term-name/use-term-name.js b/packages/block-library/src/term-name/use-term-name.js new file mode 100644 index 00000000000000..42693b02a218b4 --- /dev/null +++ b/packages/block-library/src/term-name/use-term-name.js @@ -0,0 +1,106 @@ +/** + * WordPress dependencies + */ +import { store as coreStore } from '@wordpress/core-data'; +import { useSelect } from '@wordpress/data'; + +/** + * Hook to fetch term name based on context or fallback to template parsing. + * + * This hook prioritizes context-provided termId and taxonomy, but falls back to + * template-based detection when no context is available. + * + * @param {string|number} termId The term ID from context + * @param {string} taxonomy The taxonomy name from context + */ +export function useTermName( termId, taxonomy ) { + // Get term from context if available. + const contextBasedTerm = useSelect( + ( select ) => { + if ( ! termId || ! taxonomy ) { + return null; + } + return select( coreStore ).getEntityRecord( + 'taxonomy', + taxonomy, + termId + ); + }, + [ termId, taxonomy ] + ); + + // Fallback approach: Parse template slug when no context is available. + const templateBasedTerm = useTemplateBasedTermData(); + const hasContext = Boolean( termId && taxonomy ); + + return { + hasContext, + term: hasContext ? contextBasedTerm : templateBasedTerm, + }; +} + +/** + * Fallback hook to fetch term data from template context. + * Parses the template slug to determine if we're on a specific term archive. + */ +function useTemplateBasedTermData() { + const templateSlug = useSelect( ( select ) => { + // Access core/editor by string to avoid @wordpress/editor dependency. + // eslint-disable-next-line @wordpress/data-no-store-string-literals + const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = + select( 'core/editor' ); + const currentPostType = getCurrentPostType(); + const templateId = + getCurrentTemplateId() || + ( currentPostType === 'wp_template' ? getCurrentPostId() : null ); + + return templateId + ? select( coreStore ).getEditedEntityRecord( + 'postType', + 'wp_template', + templateId + )?.slug + : null; + }, [] ); + + const taxonomyMatches = templateSlug?.match( + /^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/ + ); + + let taxonomy; + let termSlug; + + if ( taxonomyMatches ) { + // If it's for a specific term (e.g., category-news, tag-featured). + if ( taxonomyMatches[ 3 ] ) { + taxonomy = taxonomyMatches[ 6 ] + ? taxonomyMatches[ 6 ] + : taxonomyMatches[ 4 ]; + termSlug = taxonomyMatches[ 7 ]; + } + + taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy; + } + + return useSelect( + ( select ) => { + if ( ! taxonomy || ! termSlug ) { + return null; + } + + const { getEntityRecords } = select( coreStore ); + + const termRecords = getEntityRecords( 'taxonomy', taxonomy, { + slug: termSlug, + per_page: 1, + } ); + + if ( termRecords && termRecords[ 0 ] ) { + return termRecords[ 0 ]; + } + + return null; + }, + [ taxonomy, termSlug ] + ); +} From f1205dab048206b7cc94891a1993205f1f6fee3e Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 8 Oct 2025 12:01:27 +0100 Subject: [PATCH 12/23] Remove apply_filters --- packages/block-library/src/term-name/index.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index edbeac277ebb19..b6d44acb4f1ca7 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -19,19 +19,9 @@ function render_block_core_term_name( $attributes, $content, $block ) { $term_name = ''; - /** - * Filters the block context to get the current term ID and taxonomy. - * - * @since 6.9.0 - * - * @param array $context The block context. - * @param array $parsed_block The parsed block. - * @param WP_Block|null $parent_block The parent block. - */ - $context = apply_filters( 'render_block_context', $block->context, $block->parsed_block, null ); - - if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { - $term = get_term( $context['termId'], $context['taxonomy'] ); + // Get term from context or from the current query. + if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); } else { $term = get_queried_object(); if ( ! $term instanceof WP_Term ) { From af78593cbf83ef4a4b53720723a4bb85bf632ced Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 8 Oct 2025 15:02:16 +0100 Subject: [PATCH 13/23] Rename tagName to level --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/term-name/block.json | 6 +++--- packages/block-library/src/term-name/edit.js | 14 ++++---------- packages/block-library/src/term-name/index.php | 3 ++- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index aec8754b42e0bc..8162f2b53bc55b 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -999,7 +999,7 @@ Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gut - **Experimental:** true - **Category:** theme - **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** isLink, tagName, textAlign +- **Attributes:** isLink, level, textAlign ## Term Template diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index fad08cc38865c7..a68c9829aee64e 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -12,9 +12,9 @@ "textAlign": { "type": "string" }, - "tagName": { - "type": "string", - "default": "p" + "level": { + "type": "number", + "default": 0 }, "isLink": { "type": "boolean", diff --git a/packages/block-library/src/term-name/edit.js b/packages/block-library/src/term-name/edit.js index 134b3c6a32910f..dd3d7c9726edb0 100644 --- a/packages/block-library/src/term-name/edit.js +++ b/packages/block-library/src/term-name/edit.js @@ -31,7 +31,7 @@ export default function TermNameEdit( { setAttributes, context: { termId, taxonomy }, } ) { - const { textAlign, tagName = 'p', isLink } = attributes; + const { textAlign, level = 0, isLink } = attributes; const { term } = useTermName( termId, taxonomy ); const termName = term?.name || __( 'Term Name' ); @@ -44,7 +44,7 @@ export default function TermNameEdit( { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); - const TagName = tagName; + const TagName = level === 0 ? 'p' : `h${ level }`; let termNameDisplay = termName; if ( isLink ) { @@ -62,16 +62,10 @@ export default function TermNameEdit( { <> { - setAttributes( { - tagName: newLevel === 0 ? 'p' : `h${ newLevel }`, - } ); + setAttributes( { level: newLevel } ); } } /> name; - $tag_name = isset( $attributes['tagName'] ) ? $attributes['tagName'] : 'p'; + $level = isset( $attributes['level'] ) ? $attributes['level'] : 0; + $tag_name = 0 === $level ? 'p' : 'h' . (int) $level; if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $term_link = get_term_link( $term ); From f7e3c5968ea91b83ad120e3f4bfa0e91aa5edbd8 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 09:10:47 +0100 Subject: [PATCH 14/23] Add apply_filters back --- packages/block-library/src/term-name/index.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 3a2bf18bb5f210..546694cd605c2f 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -19,9 +19,19 @@ function render_block_core_term_name( $attributes, $content, $block ) { $term_name = ''; - // Get term from context or from the current query. - if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { - $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); + /** + * Filters the block context to get the current term ID and taxonomy. + * + * @since 6.9.0 + * + * @param array $context The block context. + * @param array $parsed_block The parsed block. + * @param WP_Block|null $parent_block The parent block. + */ + $context = apply_filters( 'render_block_context', $block->context, $block->parsed_block, null ); + + if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { + $term = get_term( $context['termId'], $context['taxonomy'] ); } else { $term = get_queried_object(); if ( ! $term instanceof WP_Term ) { From 8cacf01fab945ceadabd3112d5694b3dbe99863a Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 12:23:21 +0100 Subject: [PATCH 15/23] Add new icon --- packages/block-library/src/term-name/index.js | 2 +- packages/icons/src/library/term-name.svg | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 packages/icons/src/library/term-name.svg diff --git a/packages/block-library/src/term-name/index.js b/packages/block-library/src/term-name/index.js index 161f1385475abe..f74cd380dbd3d9 100644 --- a/packages/block-library/src/term-name/index.js +++ b/packages/block-library/src/term-name/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { tag as icon } from '@wordpress/icons'; +import { termName as icon } from '@wordpress/icons'; /** * Internal dependencies diff --git a/packages/icons/src/library/term-name.svg b/packages/icons/src/library/term-name.svg new file mode 100644 index 00000000000000..705789c4c909c1 --- /dev/null +++ b/packages/icons/src/library/term-name.svg @@ -0,0 +1,12 @@ + + + + From 7eccb177e5f466c7f7e3b8fa3adece06ec2d23f1 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 14:55:24 +0100 Subject: [PATCH 16/23] Remove fill from svg --- packages/icons/src/library/term-name.svg | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/icons/src/library/term-name.svg b/packages/icons/src/library/term-name.svg index 705789c4c909c1..da5aba3e20570c 100644 --- a/packages/icons/src/library/term-name.svg +++ b/packages/icons/src/library/term-name.svg @@ -1,12 +1,4 @@ - - - + + + From e59e15313670e5ec7013e994b4f557c929a48810 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 14:55:35 +0100 Subject: [PATCH 17/23] Add term title keyword --- packages/block-library/src/term-name/block.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index a68c9829aee64e..1c3a372a0a7d32 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -6,6 +6,7 @@ "title": "Term Name", "category": "theme", "description": "Displays the name of a taxonomy term.", + "keywords": [ "term title" ], "textdomain": "default", "usesContext": [ "termId", "taxonomy" ], "attributes": { From 87e8f7770266c3bd0bf19255dd6d3faedd7edc6c Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 14:57:32 +0100 Subject: [PATCH 18/23] Remove experimental flag --- docs/reference-guides/core-blocks.md | 1 - packages/block-library/src/index.js | 2 +- packages/block-library/src/term-name/block.json | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 8914374354a893..fb22091b3ac299 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -996,7 +996,6 @@ Display the description of categories, tags and custom taxonomies when viewing a Displays the name of a taxonomy term. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/term-name)) - **Name:** core/term-name -- **Experimental:** true - **Category:** theme - **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, level, textAlign diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 1ed3fb42f0e3b6..e56c6c6b00d32c 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -251,6 +251,7 @@ const getAllBlocks = () => { homeLink, logInOut, termDescription, + termName, queryTitle, postAuthorBiography, ]; @@ -258,7 +259,6 @@ const getAllBlocks = () => { if ( window?.__experimentalEnableBlockExperiments ) { blocks.push( termsQuery ); blocks.push( termTemplate ); - blocks.push( termName ); } if ( window?.__experimentalEnableFormBlocks ) { diff --git a/packages/block-library/src/term-name/block.json b/packages/block-library/src/term-name/block.json index 1c3a372a0a7d32..29b0cbe22b77e5 100644 --- a/packages/block-library/src/term-name/block.json +++ b/packages/block-library/src/term-name/block.json @@ -1,7 +1,6 @@ { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, - "__experimental": true, "name": "core/term-name", "title": "Term Name", "category": "theme", From cb608e1f1c25c7510077111f51beff1e375b3fd0 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 15:00:23 +0100 Subject: [PATCH 19/23] Fix spacing --- packages/block-library/src/term-name/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 546694cd605c2f..668857ca82d4da 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -19,7 +19,7 @@ function render_block_core_term_name( $attributes, $content, $block ) { $term_name = ''; - /** + /** * Filters the block context to get the current term ID and taxonomy. * * @since 6.9.0 From 3e12e660acd36bd2c4e943186897f934fb17bede Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 15:11:23 +0100 Subject: [PATCH 20/23] Remove apply_filters --- packages/block-library/src/term-name/index.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/term-name/index.php b/packages/block-library/src/term-name/index.php index 668857ca82d4da..3a2bf18bb5f210 100644 --- a/packages/block-library/src/term-name/index.php +++ b/packages/block-library/src/term-name/index.php @@ -19,19 +19,9 @@ function render_block_core_term_name( $attributes, $content, $block ) { $term_name = ''; - /** - * Filters the block context to get the current term ID and taxonomy. - * - * @since 6.9.0 - * - * @param array $context The block context. - * @param array $parsed_block The parsed block. - * @param WP_Block|null $parent_block The parent block. - */ - $context = apply_filters( 'render_block_context', $block->context, $block->parsed_block, null ); - - if ( isset( $context['termId'] ) && isset( $context['taxonomy'] ) ) { - $term = get_term( $context['termId'], $context['taxonomy'] ); + // Get term from context or from the current query. + if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); } else { $term = get_queried_object(); if ( ! $term instanceof WP_Term ) { From 76f35a8b1184ad00b576dcd6a7d7ba9c81a25d28 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 15:15:30 +0100 Subject: [PATCH 21/23] Add test fixture --- test/integration/fixtures/blocks/core__term-name.html | 1 + test/integration/fixtures/blocks/core__term-name.json | 11 +++++++++++ .../fixtures/blocks/core__term-name.parsed.json | 9 +++++++++ .../fixtures/blocks/core__term-name.serialized.html | 1 + 4 files changed, 22 insertions(+) create mode 100644 test/integration/fixtures/blocks/core__term-name.html create mode 100644 test/integration/fixtures/blocks/core__term-name.json create mode 100644 test/integration/fixtures/blocks/core__term-name.parsed.json create mode 100644 test/integration/fixtures/blocks/core__term-name.serialized.html diff --git a/test/integration/fixtures/blocks/core__term-name.html b/test/integration/fixtures/blocks/core__term-name.html new file mode 100644 index 00000000000000..062708273d3db5 --- /dev/null +++ b/test/integration/fixtures/blocks/core__term-name.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__term-name.json b/test/integration/fixtures/blocks/core__term-name.json new file mode 100644 index 00000000000000..8b2282f90959eb --- /dev/null +++ b/test/integration/fixtures/blocks/core__term-name.json @@ -0,0 +1,11 @@ +[ + { + "name": "core/term-name", + "isValid": true, + "attributes": { + "level": 0, + "isLink": false + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__term-name.parsed.json b/test/integration/fixtures/blocks/core__term-name.parsed.json new file mode 100644 index 00000000000000..d13cb26fcb4eb0 --- /dev/null +++ b/test/integration/fixtures/blocks/core__term-name.parsed.json @@ -0,0 +1,9 @@ +[ + { + "blockName": "core/term-name", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + } +] diff --git a/test/integration/fixtures/blocks/core__term-name.serialized.html b/test/integration/fixtures/blocks/core__term-name.serialized.html new file mode 100644 index 00000000000000..062708273d3db5 --- /dev/null +++ b/test/integration/fixtures/blocks/core__term-name.serialized.html @@ -0,0 +1 @@ + From 2644aa2ca61e7107ce7e35a7163acf2f03322875 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Thu, 9 Oct 2025 15:36:52 +0100 Subject: [PATCH 22/23] Add style import --- packages/block-library/src/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index d94343a37b1977..f66371e7a4ca82 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -71,6 +71,7 @@ @import "./table/style.scss"; @import "./table-of-contents/style.scss"; @import "./term-description/style.scss"; +@import "./term-name/style.scss"; @import "./term-template/style.scss"; @import "./terms-query/style.scss"; @import "./text-columns/style.scss"; From c334cd5d2398039cbf26112715bd965c90f686bc Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Fri, 10 Oct 2025 10:07:46 +0100 Subject: [PATCH 23/23] Update svg --- packages/icons/src/library/term-name.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/icons/src/library/term-name.svg b/packages/icons/src/library/term-name.svg index da5aba3e20570c..c4135c2511de24 100644 --- a/packages/icons/src/library/term-name.svg +++ b/packages/icons/src/library/term-name.svg @@ -1,4 +1,4 @@ - +