Remove duplicate HTML element and added classnames for single product block (https://github.com/woocommerce/woocommerce-blocks/pull/10374)

This commit is contained in:
Roy Ho 2023-08-01 12:24:35 -07:00 committed by GitHub
parent 69f1c53a41
commit 62268b7017
1 changed files with 2 additions and 6 deletions

View File

@ -75,14 +75,10 @@ class SingleProduct extends AbstractBlock {
* @return string Rendered block output.
*/
protected function render( $attributes, $content, $block ) {
$classname = $attributes['className'] ?? '';
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( sprintf( 'woocommerce %1$s', $classname ) ) ) );
$html = sprintf(
'<div %1$s>
%2$s
'<div class="woocommerce">
%1$s
</div>',
$wrapper_attributes,
$content
);