diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index dfe0f224c8f360..782489fb7e9532 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -689,7 +689,7 @@ Displays the title of a post, page, or any other content-type. ([Source](https:/ - **Name:** core/post-title - **Category:** theme - **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** isLink, level, linkTarget, rel, textAlign +- **Attributes:** isLink, level, levelOptions, linkTarget, rel, textAlign ## Preformatted diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index 9c3ba3e214e4b1..ecb5053d6cd39e 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -15,6 +15,9 @@ "type": "number", "default": 2 }, + "levelOptions": { + "type": "array" + }, "isLink": { "type": "boolean", "default": false diff --git a/packages/block-library/src/post-title/edit.js b/packages/block-library/src/post-title/edit.js index 3963016e342822..d24455f0956358 100644 --- a/packages/block-library/src/post-title/edit.js +++ b/packages/block-library/src/post-title/edit.js @@ -22,7 +22,7 @@ import { useEntityProp, store as coreStore } from '@wordpress/core-data'; import { useSelect } from '@wordpress/data'; export default function PostTitleEdit( { - attributes: { level, textAlign, isLink, rel, linkTarget }, + attributes: { level, levelOptions, textAlign, isLink, rel, linkTarget }, setAttributes, context: { postType, postId, queryId }, insertBlocksAfter, @@ -125,6 +125,7 @@ export default function PostTitleEdit( { setAttributes( { level: newLevel } ) }