Automattic\WooCommerce\Blocks\BlockTypes

EmailContent::render │ protected │ WC 1.0

Renders Woo content placeholder to be replaced by content during sending.

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

Хуков нет.

Возвращает

string. Rendered block output.

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

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

Код EmailContent::render() WC 11.2.1

protected function render( $attributes, $content, $block ) {
	// phpcs:disable WordPress.Security.NonceVerification.Recommended
	if ( defined( 'REST_REQUEST' ) && REST_REQUEST && isset( $_GET['context'] ) && 'edit' === sanitize_text_field( wp_unslash( $_GET['context'] ) ) ) {
		// Block is being rendered for ServerSideRender editor preview.
		return $this->render_preview( $attributes );
	}

	return BlockEmailRenderer::WOO_EMAIL_CONTENT_PLACEHOLDER;
}