Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailScratchpadRefresher::maybe_refresh │ public │ WC 1.0

Refresh the scratchpad from the current file template when it was never edited by the user.

Method of the class: WCEmailScratchpadRefresher{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WCEmailScratchpadRefresher = new WCEmailScratchpadRefresher();
$WCEmailScratchpadRefresher->maybe_refresh( $scratchpad, $email ): void;
$scratchpad(WP_Post) (required)
The unpublished scratchpad post.
$email(WC_Email) (required)
The email instance.

WCEmailScratchpadRefresher::maybe_refresh() code WC 11.2.1

public function maybe_refresh( \WP_Post $scratchpad, \WC_Email $email ): void {
	if ( ! $this->was_never_edited( $scratchpad ) ) {
		return;
	}

	$this->refresh_content( $scratchpad, $email );
}