Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateChangeSummary::clean_inner_textprivate staticWC 1.0

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 innerHTML string from a parsed block.

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 );
}