From 1962950e25e1b07fb7cbf16704a1bd3b6548520c Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Mon, 23 May 2022 17:08:40 +0100 Subject: [PATCH 1/2] Button Elemnt: Add support to Site Editor --- packages/block-library/src/post-comments-form/form.js | 2 +- packages/block-library/src/post-comments-form/index.php | 2 +- packages/block-library/src/post-comments/index.php | 2 +- packages/blocks/src/api/constants.js | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/post-comments-form/form.js b/packages/block-library/src/post-comments-form/form.js index 51212c925cec50..4a195d4f63a68c 100644 --- a/packages/block-library/src/post-comments-form/form.js +++ b/packages/block-library/src/post-comments-form/form.js @@ -27,7 +27,7 @@ const CommentsForm = () => { diff --git a/packages/block-library/src/post-comments-form/index.php b/packages/block-library/src/post-comments-form/index.php index accceace3cdb9b..c2ef5bcb762a60 100644 --- a/packages/block-library/src/post-comments-form/index.php +++ b/packages/block-library/src/post-comments-form/index.php @@ -72,7 +72,7 @@ function register_block_core_post_comments_form() { */ function post_comments_form_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; } diff --git a/packages/block-library/src/post-comments/index.php b/packages/block-library/src/post-comments/index.php index 2b20a9494eef3e..5520184408b242 100644 --- a/packages/block-library/src/post-comments/index.php +++ b/packages/block-library/src/post-comments/index.php @@ -78,7 +78,7 @@ function register_block_core_post_comments() { */ function post_comments_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; } diff --git a/packages/blocks/src/api/constants.js b/packages/blocks/src/api/constants.js index a5ed771d72d2fa..df0f05fdf5fe92 100644 --- a/packages/blocks/src/api/constants.js +++ b/packages/blocks/src/api/constants.js @@ -189,6 +189,7 @@ export const __EXPERIMENTAL_ELEMENTS = { h4: 'h4', h5: 'h5', h6: 'h6', + button: '.wp-element-button, .wp-block-button__link', }; export const __EXPERIMENTAL_PATHS_WITH_MERGE = { From 957b0a0d0d62fcef5baded9235c38dad4bb3f9d5 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Mon, 23 May 2022 17:24:05 +0100 Subject: [PATCH 2/2] remove unconnected changes --- packages/block-library/src/post-comments-form/form.js | 2 +- packages/block-library/src/post-comments-form/index.php | 2 +- packages/block-library/src/post-comments/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/post-comments-form/form.js b/packages/block-library/src/post-comments-form/form.js index 4a195d4f63a68c..51212c925cec50 100644 --- a/packages/block-library/src/post-comments-form/form.js +++ b/packages/block-library/src/post-comments-form/form.js @@ -27,7 +27,7 @@ const CommentsForm = () => { diff --git a/packages/block-library/src/post-comments-form/index.php b/packages/block-library/src/post-comments-form/index.php index c2ef5bcb762a60..accceace3cdb9b 100644 --- a/packages/block-library/src/post-comments-form/index.php +++ b/packages/block-library/src/post-comments-form/index.php @@ -72,7 +72,7 @@ function register_block_core_post_comments_form() { */ function post_comments_form_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; } diff --git a/packages/block-library/src/post-comments/index.php b/packages/block-library/src/post-comments/index.php index 5520184408b242..2b20a9494eef3e 100644 --- a/packages/block-library/src/post-comments/index.php +++ b/packages/block-library/src/post-comments/index.php @@ -78,7 +78,7 @@ function register_block_core_post_comments() { */ function post_comments_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; }