diff --git a/CHANGELOG.md b/CHANGELOG.md index bb3d37c8..11ce66a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ All notable changes to `WP Curate` will be documented in this file. -## 2.2.3 - 2024-0826 +## 2.3.0 - 2024-08-28 + +- Enhancement: Enable block filter support for Post Title block setting Heading Level select. + +## 2.2.3 - 2024-08-26 - Stack post buttons (move, pin, etc.) in smaller block widths. @@ -12,7 +16,7 @@ All notable changes to `WP Curate` will be documented in this file. ## 2.2.1 - 2024-08-15 - - Bug Fix: Handle cases where a pinned post has been deleted or unpublished. +- Bug Fix: Handle cases where a pinned post has been deleted or unpublished. ## 2.2.0 - 2024-08-05 diff --git a/blocks/post-title/block.json b/blocks/post-title/block.json index 9cb901fe..80d0ae07 100644 --- a/blocks/post-title/block.json +++ b/blocks/post-title/block.json @@ -15,6 +15,10 @@ "level": { "type": "number", "default": 3 + }, + "supportsLevel": { + "type": "boolean", + "default": true } }, "render": "file:render.php", diff --git a/blocks/post-title/edit.tsx b/blocks/post-title/edit.tsx index beb20db4..e6b1060b 100644 --- a/blocks/post-title/edit.tsx +++ b/blocks/post-title/edit.tsx @@ -9,6 +9,7 @@ interface PostTitleEditProps { clientId?: string; attributes: { level?: number; + supportsLevel?: boolean; }; context: { postId: number; @@ -48,11 +49,11 @@ export default function Edit({ query: { postType = 'post' }, customPostTitles = [], } = context; - const { level = 3 } = attributes; + const { level = 3, supportsLevel } = attributes; const [rawTitle = '', , fullTitle] = useEntityProp('postType', postType, 'title', postId.toString()); const isPinned = pinnedPosts.includes(postId); const currentCustomPostTitle = customPostTitles.find((item) => item?.postId === postId); - const TagName = level === 0 ? 'p' : `h${level}`; + const TagName = !supportsLevel || level === 0 ? 'p' : `h${level}`; const blockProps = useBlockProps(); useEffect(() => { @@ -146,30 +147,32 @@ export default function Edit({ return ( <> { titleElement } - - - { - setAttributes({ level: parseInt(newLevel, 10) }); - }} - /> - - + {supportsLevel ? ( + + + { + setAttributes({ level: parseInt(newLevel, 10) }); + }} + /> + + + ) : null} ); } diff --git a/wp-curate.php b/wp-curate.php index ab0676c5..d9fff85d 100644 --- a/wp-curate.php +++ b/wp-curate.php @@ -3,7 +3,7 @@ * Plugin Name: WP Curate * Plugin URI: https://github.com/alleyinteractive/wp-curate * Description: Plugin to curate homepages and other landing pages - * Version: 2.2.3 + * Version: 2.3.0 * Author: Alley Interactive * Author URI: https://github.com/alleyinteractive/wp-curate * Requires at least: 6.4