Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

AbstractOrderConfirmationBlock::renderprotectedWC 1.0

Render the block.

Метод класса: AbstractOrderConfirmationBlock{}

Хуков нет.

Возвращает

Строку. | void Rendered block output.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->render( $attributes, $content, $block );
$attributes(массив) (обязательный)
Block attributes.
$content(строка) (обязательный)
Block content.
$block(WP_Block) (обязательный)
Block instance.

Код AbstractOrderConfirmationBlock::render() WC 10.5.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();
	$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 )
	) : '';
}