Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,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 (padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** isLink, level, textAlign
- **Attributes:** isLink, level, levelOptions, textAlign

## Term Template

Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/term-name/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"isLink": {
"type": "boolean",
"default": false
},
"levelOptions": {
"type": "array"
}
},
"supports": {
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/term-name/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function TermNameEdit( {
setAttributes,
context: { termId, taxonomy },
} ) {
const { textAlign, level = 0, isLink } = attributes;
const { textAlign, level = 0, isLink, levelOptions } = attributes;
const { term } = useTermName( termId, taxonomy );

const termName = term?.name
Expand Down Expand Up @@ -66,7 +66,7 @@ export default function TermNameEdit( {
<BlockControls group="block">
<HeadingLevelDropdown
value={ level }
options={ [ 0, 1, 2, 3, 4, 5, 6 ] }
options={ levelOptions }
onChange={ ( newLevel ) => {
setAttributes( { level: newLevel } );
} }
Expand Down
Loading