Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

Status::render()protectedWC 1.0

This block uses a custom render method so that the email verification form can be appended to the block. This does not inherit styles from the parent block.

Method of the class: Status{}

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.

Status::render() code WC 9.0.1

protected function render( $attributes, $content, $block ) {
	$order     = $this->get_order();
	$classname = $attributes['className'] ?? '';

	if ( isset( $attributes['align'] ) ) {
		$classname .= " align{$attributes['align']}";
	}

	$block = parent::render( $attributes, $content, $block );

	if ( ! $block ) {
		return '';
	}

	$additional_content = $this->render_confirmation_notice( $order );

	return $additional_content ? $block . sprintf(
		'<div class="wc-block-order-confirmation-status-description %1$s">%2$s</div>',
		esc_attr( trim( $classname ) ),
		$additional_content
	) : $block;
}