Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateChangeSummary::merchant_changed │ public static │ WC 11.3.0

Whether the merchant has touched a block since the base render. Compares the markup and the attributes, not the stripped text: a swapped personalization tag, an added link, a colour or a block lock are all merchant edits, and a block they have edited is never updated without asking them. When in doubt the answer is "edited": that asks the merchant rather than overwriting them.

Core's side is deliberately compared on inner_text alone by the callers. A core change the merchant cannot see as a wording change would otherwise reach the drawer as an entry whose before and after text are identical.

Public so WCEmailTemplateSelectiveApplier{} decides from the same rule that produced the summary the merchant reviewed, rather than reading the classification back out of a cached payload.

Method of the class: WCEmailTemplateChangeSummary{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = WCEmailTemplateChangeSummary::merchant_changed( $base, $post ): bool;
$base(array{inner_text:string, attrs_hash:string, inner_html_hash:string}) (required)
Base-side record.
$post(array{inner_text:string, attrs_hash:string, inner_html_hash:string}) (required)
Post-side record.

Changelog

Since 11.3.0 Introduced.

WCEmailTemplateChangeSummary::merchant_changed() code WC 11.3.0

public static function merchant_changed( array $base, array $post ): bool {
	return $base['inner_html_hash'] !== $post['inner_html_hash']
		|| $base['attrs_hash'] !== $post['attrs_hash'];
}