Automattic\WooCommerce\Blocks\BlockTypes
MiniCartTitleLabelBlock::render
Render the block.
Method of the class: MiniCartTitleLabelBlock{}
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.
MiniCartTitleLabelBlock::render() MiniCartTitleLabelBlock::render code WC 11.1.2
<?php
protected function render( $attributes, $content, $block ) {
$default_cart_label = __( 'Your cart', 'woocommerce' );
$cart_label = $attributes['label'] ? $attributes['label'] : $default_cart_label;
$wrapper_attributes = get_block_wrapper_attributes();
ob_start();
?>
<span <?php echo $wrapper_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php echo esc_html( $cart_label ); ?>
</span>
<?php
return (string) ob_get_clean();
}