Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails
WCEmailTemplateChangeSummary::clean_inner_text
Strip tags and collapse whitespace. Used as the basis for copy-change comparison — semantic content only, no markup-shape noise.
Method of the class: WCEmailTemplateChangeSummary{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WCEmailTemplateChangeSummary::clean_inner_text( $html ): string;
- $html(string) (required)
- Raw
innerHTMLstring from a parsed block.
WCEmailTemplateChangeSummary::clean_inner_text() WCEmailTemplateChangeSummary::clean inner text code WC 10.9.4
private static function clean_inner_text( string $html ): string {
$stripped = wp_strip_all_tags( $html );
$collapsed = preg_replace( '/\s+/', ' ', (string) $stripped );
return trim( (string) $collapsed );
}