Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateChangeSummary::block_label │ private static │ WC 1.0

Convert a normalized block name into a human-readable label. Used for both structured payload entries and the localized catalog.

core/heading → Heading; woocommerce/email-content → Email content.

Метод класса: WCEmailTemplateChangeSummary{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WCEmailTemplateChangeSummary::block_label( $normalized_name ): string;
$normalized_name(строка) (обязательный)
Normalized block name.

Код WCEmailTemplateChangeSummary::block_label() WC 11.2.2

private static function block_label( string $normalized_name ): string {
	$bare = preg_replace( '#^[a-z0-9\-]+/#', '', $normalized_name );
	$bare = (string) $bare;
	$bare = str_replace( array( '-', '_' ), ' ', $bare );
	$bare = trim( $bare );
	if ( '' === $bare ) {
		return $normalized_name;
	}
	return ucfirst( $bare );
}