Automattic\WooCommerce\Blocks\BlockTypes
MiniCartItemsBlock::render
Render the markup for the Mini-Cart Contents block.
Метод класса: MiniCartItemsBlock{}
Хуков нет.
Возвращает
string. Rendered block type output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render( $attributes, $content, $block );
- $attributes(массив) (обязательный)
- Block attributes.
- $content(строка) (обязательный)
- Block content.
- $block(WP_Block) (обязательный)
- Block instance.
Код MiniCartItemsBlock::render() MiniCartItemsBlock::render 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();
}