Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::generate_template_slug_from_path()public staticWC 1.0

Converts template paths into a slug

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

String. slug

Usage

$result = BlockTemplateUtils::generate_template_slug_from_path( $path );
$path(string) (required)
The template's path.

BlockTemplateUtils::generate_template_slug_from_path() code WC 9.4.2

public static function generate_template_slug_from_path( $path ) {
	$template_extension = '.html';

	return basename( $path, $template_extension );
}