From 29295fe5f1cdd7f63f71ad8dc4c071f46c355cf9 Mon Sep 17 00:00:00 2001 From: Luis Herranz Date: Tue, 6 Aug 2024 12:27:26 +0200 Subject: [PATCH] Stringify the autoclose value --- packages/block-library/src/accordion-group/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/accordion-group/index.php b/packages/block-library/src/accordion-group/index.php index a71cd8b84a584..e41c67e385494 100644 --- a/packages/block-library/src/accordion-group/index.php +++ b/packages/block-library/src/accordion-group/index.php @@ -31,11 +31,11 @@ function render_block_core_accordion_group( $attributes, $content ) { wp_enqueue_script_module( '@wordpress/block-library/accordion-group' ); $p = new WP_HTML_Tag_Processor( $content ); - $autoclose = (bool) $attributes['autoclose']; + $autoclose = $attributes['autoclose'] ? 'true' : 'false'; if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-group' ) ) ) { $p->set_attribute( 'data-wp-interactive', 'core/accordion' ); - $p->set_attribute( 'data-wp-context', '{ "autoclose": "' . $autoclose . '" }' ); + $p->set_attribute( 'data-wp-context', '{ "autoclose": ' . $autoclose . ' }' ); // Only modify content if directives have been set. $content = $p->get_updated_html();