MiniCartItemsBlock.php
<?php
namespace Automattic\WooCommerce\Blocks\BlockTypes;
/**
* MiniCartItemsBlock class.
*/
class MiniCartItemsBlock extends AbstractInnerBlock {
/**
* Block name.
*
* @var string
*/
protected $block_name = 'mini-cart-items-block';
/**
* Render the markup for the Mini-Cart Contents block.
*
* @param array $attributes Block attributes.
* @param string $content Block content.
* @param \WP_Block $block Block instance.
* @return string Rendered block type output.
*/
protected function render( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => 'wc-block-mini-cart__items',
'tabindex' => '-1',
)
);
ob_start();
?>
<div <?php echo $wrapper_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php
return (string) ob_get_clean();
}
}