Skip to content

Commit

Permalink
Stringify the autoclose value
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz authored and jffng committed Aug 6, 2024
1 parent cf2797f commit 29295fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/accordion-group/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 29295fe

Please sign in to comment.