Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::generate_template_slug_from_path()
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() 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 ); }