Automattic\WooCommerce\Admin\Features\ProductBlockEditor

BlockTemplateUtils::get_block_template_path()public staticWC 1.0

Return the path to a block template file. Otherwise, False.

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

String|true|false. Path to the template file or false.

Usage

$result = BlockTemplateUtils::get_block_template_path( $slug );
$slug(string) (required)
- Template slug.

BlockTemplateUtils::get_block_template_path() code WC 9.7.1

public static function get_block_template_path( $slug ) {
	$directory = self::get_templates_directory();
	$path      = trailingslashit( $directory ) . $slug . '.php';

	if ( ! file_exists( $path ) ) {
		return false;
	}

	return $path;
}