Automattic\WooCommerce\Admin\Features\ProductBlockEditor

BlockTemplateUtils::get_templates_directory()private staticWC 1.0

Gets the directory where templates of a specific template type can be found.

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

String.

Usage

$result = BlockTemplateUtils::get_templates_directory( $template_type );
$template_type(string)
wp_template or wp_template_part.
Default: 'wp_template'

BlockTemplateUtils::get_templates_directory() code WC 9.4.2

private static function get_templates_directory( $template_type = 'wp_template' ) {
	$root_path                = dirname( __DIR__, 4 ) . '/' . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR;
	$templates_directory      = $root_path . self::DIRECTORY_NAMES['TEMPLATES'];
	$template_parts_directory = $root_path . self::DIRECTORY_NAMES['TEMPLATE_PARTS'];

	if ( 'wp_template_part' === $template_type ) {
		return $template_parts_directory;
	}

	return $templates_directory;
}