Automattic\WooCommerce\Blocks\BlockTypes

MiniCartItemsBlock::render │ protected │ WC 1.0

Render the markup for the Mini-Cart Contents block.

Method of the class: MiniCartItemsBlock{}

No Hooks.

Returns

string. Rendered block type output.

Usage

// protected - for code of main (parent) or child class
$result = $this->render( $attributes, $content, $block );
$attributes(array) (required)
Block attributes.
$content(string) (required)
Block content.
$block(WP_Block) (required)
Block instance.

MiniCartItemsBlock::render() code WC 11.1.2

<?php
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();
}