Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::render()protectedWC 1.0

Render the block.

Method of the class: AbstractOrderConfirmationBlock{}

No Hooks.

Return

String. | void Rendered block 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.

AbstractOrderConfirmationBlock::render() code WC 8.9.0

protected function render( $attributes, $content, $block ) {
	$order              = $this->get_order();
	$permission         = $this->get_view_order_permissions( $order );
	$block_content      = $order ? $this->render_content( $order, $permission, $attributes, $content ) : $this->render_content_fallback();
	$classname          = $attributes['className'] ?? '';
	$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );

	if ( ! empty( $classes_and_styles['classes'] ) ) {
		$classname .= ' ' . $classes_and_styles['classes'];
	}

	return $block_content ? sprintf(
		'<div class="wc-block-%4$s %1$s" style="%2$s">%3$s</div>',
		esc_attr( trim( $classname ) ),
		esc_attr( $classes_and_styles['styles'] ),
		$block_content,
		esc_attr( $this->block_name )
	) : '';
}