Automattic\WooCommerce\EmailEditor\Engine

Send_Preview_Email::add_preview_contextpublicWC 1.0

Add preview context to email rendering.

This filter callback adds the is_user_preview flag and current user information to the rendering context, allowing block renderers to show appropriate preview content.

Method of the class: Send_Preview_Email{}

No Hooks.

Returns

Array. Modified email context with preview flag.

Usage

$Send_Preview_Email = new Send_Preview_Email();
$Send_Preview_Email->add_preview_context( $email_context ): array;
$email_context(array) (required)
Email context data.

Send_Preview_Email::add_preview_context() code WC 10.4.3

public function add_preview_context( $email_context ): array {
	$email_context['is_user_preview'] = true;
	return $email_context;
}