Automattic\WooCommerce\Blocks\BlockTypes

MiniCartTitleLabelBlock::render_experimental_iapi_title_label_blockprotectedWC 1.0

Render the interactivity API powered experimental title 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_experimental_iapi_title_label_block( $attributes, $content, $block );
$attributes(array) (required)
Block attributes.
$content(string) (required)
Block content.
$block(WP_Block) (required)
Block instance.

MiniCartTitleLabelBlock::render_experimental_iapi_title_label_block() code WC 10.8.1

<?php
protected function render_experimental_iapi_title_label_block( $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 ob_get_clean();
}