Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::get_block_template_title()public staticWC 1.0

Returns template title.

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

String. Human friendly title.

Usage

$result = BlockTemplateUtils::get_block_template_title( $template_slug );
$template_slug(string) (required)
The template slug (e.g. single-product).

BlockTemplateUtils::get_block_template_title() code WC 9.4.2

public static function get_block_template_title( $template_slug ) {
	$registered_template = self::get_template( $template_slug );
	if ( isset( $registered_template ) ) {
		return $registered_template->get_template_title();
	} else {
		// Human friendly title converted from the slug.
		return ucwords( preg_replace( '/[\-_]/', ' ', $template_slug ) );
	}
}