Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails
WCTransactionalEmailPostsGenerator::compute_canonical_post_content
Compute the canonical post_content a given email.
Returns the post_content that the generator would persist for this email after the woocommerce_email_content_post_data runs, i.e. the exact string whose sha1 is stamped into _wc_email_template_source_hash.
Callers can hash the return value to obtain currentCoreHash for divergence detection.
Метод класса: WCTransactionalEmailPostsGenerator{}
Хуков нет.
Возвращает
string. The canonical post content.
Использование
$result = WCTransactionalEmailPostsGenerator::compute_canonical_post_content( $email ): string;
- $email(WC_Email) (обязательный)
- The transactional email instance.
Список изменений
| С версии 10.8.0 | Введена. |
Код WCTransactionalEmailPostsGenerator::compute_canonical_post_content() WCTransactionalEmailPostsGenerator::compute canonical post content WC 11.2.2
public static function compute_canonical_post_content( $email ): string {
$post_data = self::build_filtered_post_data( (string) $email->id, $email );
return (string) ( $post_data['post_content'] ?? '' );
}