Clean up rendering of block attributes

This commit is contained in:
Sam Seay 2024-09-10 12:33:46 +08:00
parent 290401458b
commit dffda6d358
No known key found for this signature in database
GPG Key ID: 2223711A9151668A
1 changed files with 4 additions and 2 deletions

View File

@ -508,9 +508,11 @@ class MiniCartInteractivity extends AbstractBlock {
'hasHiddenPrice' => isset( $attributes['hasHiddenPrice'] ) ? $attributes['hasHiddenPrice'] : false,
'amount' => 0,
);
$wrapper_attributes = get_block_wrapper_attributes(
$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => $wrapper_classes,
'style' => $wrapper_styles,
)
);
@ -519,7 +521,7 @@ class MiniCartInteractivity extends AbstractBlock {
ob_start();
?>
<div style="<?php echo esc_attr( $wrapper_styles ); ?>" class="wp-block-woocommerce-mini-cart-interactivity">
<div style="<?php echo esc_attr( $wrapper_attributes ); ?>" >
<div data-wc-interactive='<?php echo esc_attr( $interactivity_namespace ); ?>' data-wc-context='<?php echo esc_attr( wp_json_encode( $cart_context ) ); ?>'>
<?php
// Output is already escaped in the function call.