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.

Метод класса: BlockTemplateUtils{}

Хуков нет.

Возвращает

Строку.

Использование

$result = BlockTemplateUtils::get_templates_directory( $template_type );
$template_type(строка)
wp_template or wp_template_part.
По умолчанию: 'wp_template'

Код BlockTemplateUtils::get_templates_directory() 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;
}