Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateChangeSummary::write_cache │ private static │ WC 1.0

Write a payload to the transient cache, pre-stamping cache_hit so any subsequent read is honest about its origin.

Method of the class: WCEmailTemplateChangeSummary{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = WCEmailTemplateChangeSummary::write_cache( $cache_key, $payload ): void;
$cache_key(string) (required)
Transient key.
$payload(array<string, mixed>) (required)
The payload to cache.

WCEmailTemplateChangeSummary::write_cache() code WC 11.3.0

private static function write_cache( string $cache_key, array $payload ): void {
	$to_cache              = $payload;
	$to_cache['cache_hit'] = true;
	set_transient( $cache_key, $to_cache, self::CACHE_TTL );
}