WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::convert_slug_to_title() public WC 1.0

Converts template slugs into readable titles.

{} It's a method of the class: BlockTemplateUtils{}

No Hooks.

Return

String. Human friendly title converted from the slug.

Usage

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

Code of BlockTemplateUtils::convert_slug_to_title() WC 6.1.1

public static function convert_slug_to_title( $template_slug ) {
	switch ( $template_slug ) {
		case 'single-product':
			return __( 'Single Product Page', 'woocommerce' );
		case 'archive-product':
			return __( 'Product Archive Page', 'woocommerce' );
		case 'taxonomy-product_cat':
			return __( 'Product Category Page', 'woocommerce' );
		case 'taxonomy-product_tag':
			return __( 'Product Tag Page', 'woocommerce' );
		default:
			// Replace all hyphens and underscores with spaces.
			return ucwords( preg_replace( '/[\-_]/', ' ', $template_slug ) );
	}
}