Automattic\WooCommerce\Blocks\Templates
SingleProductTemplateCompatibility::create_wrap_block_group()
Wrap all the blocks inside the template in a group block.
Метод класса: SingleProductTemplateCompatibility{}
Хуков нет.
Возвращает
Массив
. Group block with the blocks inside.
Использование
$result = SingleProductTemplateCompatibility::create_wrap_block_group( $blocks );
- $blocks(массив) (обязательный)
- Array of parsed block objects.
Код SingleProductTemplateCompatibility::create_wrap_block_group() SingleProductTemplateCompatibility::create wrap block group WC 9.2.3
private static function create_wrap_block_group( $blocks ) { $serialized_blocks = serialize_blocks( $blocks ); $new_block = parse_blocks( sprintf( '<!-- wp:group {"className":"woocommerce product"} --> <div class="wp-block-group woocommerce product"> %1$s </div> <!-- /wp:group -->', $serialized_blocks ) ); $new_block['innerBlocks'] = $blocks; return $new_block; }