Add missing `wp-block-` classnames to order confirmation blocks, Store Notices, and Breadcrumbs (#51380)
* Add missing wp-block-x classname to order confirmation blocks * Use get_block_wrapper_attributes for store notices block * Breadcrumbs and notices * Changelog
This commit is contained in:
parent
66523872f3
commit
be17f843b6
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Added missing wp-block- classes to order confirmation, store notices, and breadcrumb blocks.
|
|
@ -34,14 +34,16 @@ class Breadcrumbs extends AbstractBlock {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$classname = $attributes['className'] ?? '';
|
|
||||||
$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );
|
$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );
|
||||||
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<div class="woocommerce wc-block-breadcrumbs %1$s %2$s" style="%3$s">%4$s</div>',
|
'<div %1$s>%2$s</div>',
|
||||||
esc_attr( $classes_and_styles['classes'] ),
|
get_block_wrapper_attributes(
|
||||||
esc_attr( $classname ),
|
array(
|
||||||
esc_attr( $classes_and_styles['styles'] ),
|
'class' => 'wc-block-breadcrumbs woocommerce ' . esc_attr( $classes_and_styles['classes'] ),
|
||||||
|
'style' => $classes_and_styles['styles'],
|
||||||
|
)
|
||||||
|
),
|
||||||
$breadcrumb
|
$breadcrumb
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,12 @@ abstract class AbstractOrderConfirmationBlock extends AbstractBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $block_content ? sprintf(
|
return $block_content ? sprintf(
|
||||||
'<div class="wc-block-%4$s %1$s" style="%2$s">%3$s</div>',
|
'<div class="wp-block-%5$s-%4$s wc-block-%4$s %1$s" style="%2$s">%3$s</div>',
|
||||||
esc_attr( trim( $classname ) ),
|
esc_attr( trim( $classname ) ),
|
||||||
esc_attr( $classes_and_styles['styles'] ),
|
esc_attr( $classes_and_styles['styles'] ),
|
||||||
$block_content,
|
$block_content,
|
||||||
esc_attr( $this->block_name )
|
esc_attr( $this->block_name ),
|
||||||
|
esc_attr( $this->namespace )
|
||||||
) : '';
|
) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,17 +45,15 @@ class StoreNotices extends AbstractBlock {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$classname = isset( $attributes['className'] ) ? $attributes['className'] : '';
|
|
||||||
$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );
|
$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );
|
||||||
|
|
||||||
if ( isset( $attributes['align'] ) ) {
|
|
||||||
$classname .= " align{$attributes['align']}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<div class="woocommerce wc-block-store-notices %1$s %2$s">%3$s</div>',
|
'<div %1$s>%2$s</div>',
|
||||||
esc_attr( $classes_and_styles['classes'] ),
|
get_block_wrapper_attributes(
|
||||||
esc_attr( $classname ),
|
array(
|
||||||
|
'class' => 'wc-block-store-notices woocommerce ' . esc_attr( $classes_and_styles['classes'] ),
|
||||||
|
)
|
||||||
|
),
|
||||||
wc_kses_notice( $notices )
|
wc_kses_notice( $notices )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue