From 9820dcea62e070193d5c8d4d69e3d2b813cf1e42 Mon Sep 17 00:00:00 2001 From: mricoul Date: Tue, 17 Feb 2026 11:21:03 +0100 Subject: [PATCH 1/4] feat: allows button blocks in FAQ answer Extends the allowed blocks within the FAQ answer block to include button and buttons blocks. This provides users with more flexibility in designing FAQ answers. --- src/faq-answer/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faq-answer/edit.js b/src/faq-answer/edit.js index b76f4cf..3c86d7d 100644 --- a/src/faq-answer/edit.js +++ b/src/faq-answer/edit.js @@ -4,7 +4,7 @@ import { useBlockProps, InnerBlocks } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; -const ALLOWED_BLOCKS = [ 'core/paragraph', 'core/heading', 'core/list' ]; +const ALLOWED_BLOCKS = [ 'core/paragraph', 'core/heading', 'core/list', 'core/buttons', 'core/button' ]; export default function Edit() { const blockProps = useBlockProps( { From 38c4d9d1604e0258cdf62d29cb70c7d63081aa64 Mon Sep 17 00:00:00 2001 From: mricoul Date: Tue, 17 Feb 2026 11:21:17 +0100 Subject: [PATCH 2/4] feat: adds spacing and typography support Adds support for spacing control to the FAQ Answer block, enabling margin, padding, and block gap adjustments. Enables font size control for the FAQ Question block, allowing users to customize the question's typography. --- src/faq-answer/block.json | 7 ++++++- src/faq-question/block.json | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/faq-answer/block.json b/src/faq-answer/block.json index 25e6649..7132ce1 100644 --- a/src/faq-answer/block.json +++ b/src/faq-answer/block.json @@ -10,7 +10,12 @@ "supports": { "html": false, "inserter": false, - "reusable": false + "reusable": false, + "spacing": { + "margin": true, + "padding": true, + "blockGap": true + } }, "attributes": { "isAccordion": { diff --git a/src/faq-question/block.json b/src/faq-question/block.json index 5302b64..f3c09c2 100644 --- a/src/faq-question/block.json +++ b/src/faq-question/block.json @@ -10,7 +10,10 @@ "supports": { "html": false, "inserter": false, - "reusable": false + "reusable": false, + "typography": { + "fontSize": true + } }, "attributes": { "question": { From 42e11ab9cfb224af13f7b2dbb47367bbc9f67d33 Mon Sep 17 00:00:00 2001 From: mricoul Date: Tue, 17 Feb 2026 11:22:04 +0100 Subject: [PATCH 3/4] feat: sanitizes FAQ question text Ensures the question text in the FAQ schema is properly sanitized by stripping all HTML tags. This prevents potential issues with unwanted HTML formatting affecting the schema output and causing unexpected behavior, such as when button blocks are used within FAQ questions. --- includes/schema/faq_schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/schema/faq_schema.php b/includes/schema/faq_schema.php index 1c7dd91..839b362 100644 --- a/includes/schema/faq_schema.php +++ b/includes/schema/faq_schema.php @@ -226,7 +226,7 @@ protected function generate_question_block( string $question_text, string $answe '@id' => $url, 'position' => $position, 'url' => $url, - 'name' => esc_html( $question_text ), + 'name' => esc_html( wp_strip_all_tags( $question_text ) ), 'answerCount' => 1, 'acceptedAnswer' => $this->add_accepted_answer_property( $answer_content ), ]; From 85740bacdf7b4b5e4de8cb340d2db422ff16dcc1 Mon Sep 17 00:00:00 2001 From: mricoul Date: Tue, 17 Feb 2026 11:22:15 +0100 Subject: [PATCH 4/4] style(js): format js lint --- src/faq-answer/edit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/faq-answer/edit.js b/src/faq-answer/edit.js index 3c86d7d..e5ae80b 100644 --- a/src/faq-answer/edit.js +++ b/src/faq-answer/edit.js @@ -4,7 +4,13 @@ import { useBlockProps, InnerBlocks } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; -const ALLOWED_BLOCKS = [ 'core/paragraph', 'core/heading', 'core/list', 'core/buttons', 'core/button' ]; +const ALLOWED_BLOCKS = [ + 'core/paragraph', + 'core/heading', + 'core/list', + 'core/buttons', + 'core/button', +]; export default function Edit() { const blockProps = useBlockProps( {