Automattic\WooCommerce\EmailEditor\Engine

Email_Editor::load_email_preview_templatepublicWC 1.0

Use a custom page template for the email editor frontend rendering.

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

Хуков нет.

Возвращает

Строку.

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

$Email_Editor = new Email_Editor();
$Email_Editor->load_email_preview_template( $template );
$template(строка) (обязательный)
post template.

Код Email_Editor::load_email_preview_template() WC 10.0.2

public function load_email_preview_template( $template ) {
	$post = $this->get_current_post();

	if ( ! $post instanceof \WP_Post ) {
		return $template;
	}

	if ( ! $this->current_post_is_email_post_type( $post->post_type ) ) {
		return $template;
	}

	add_filter(
		'woocommerce_email_editor_preview_post_template_html',
		function () use ( $post ) {
			// Generate HTML content for email editor post.
			return $this->send_preview_email->render_html( $post );
		}
	);

	return __DIR__ . '/Templates/single-email-post-template.php';
}