Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation
Status::render
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.
Метод класса: Status{}
Хуков нет.
Возвращает
Строку. | void Rendered block output.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render( $attributes, $content, $block );
- $attributes(массив) (обязательный)
- Block attributes.
- $content(строка) (обязательный)
- Block content.
- $block(WP_Block) (обязательный)
- Block instance.
Код Status::render() Status::render WC 10.4.3
protected function render( $attributes, $content, $block ) {
$order = $this->get_order();
$classname = StyleAttributesUtils::get_classes_by_attributes( $attributes, array( 'extra_classes' ) );
if ( isset( $attributes['align'] ) ) {
$classname .= " align{$attributes['align']}";
}
$block = parent::render( $attributes, $content, $block );
if ( ! $block ) {
return '';
}
$additional_content = $this->render_confirmation_notice( $order );
if ( $additional_content ) {
$block = $block . sprintf(
'<div class="wc-block-order-confirmation-status-description %1$s">%2$s</div>',
esc_attr( trim( $classname ) ),
$additional_content
);
}
return $block;
}