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 9.6.1

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();
	$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );

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