Automattic\WooCommerce\Admin\Features\ProductBlockEditor
BlockTemplateUtils::get_templates_directory
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() BlockTemplateUtils::get templates directory WC 10.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;
}