# get_template_directory_uri()

URL: https://chugunov.pro/api-wordpress/functions/get_template_directory_uri/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 1.5.0.

## Сигнатура

```php
get_template_directory_uri(): string
```

## Описание

Возвращает URI каталога шаблона активной темы.

## Возвращаемое значение

`string`

## Исходный код

Файл: `wp-includes/theme.php:361`

```php
function get_template_directory_uri() {
	$template         = str_replace( '%2F', '/', rawurlencode( get_template() ) );
	$theme_root_uri   = get_theme_root_uri( $template );
	$template_dir_uri = "$theme_root_uri/$template";

	/**
	 * Filters the active theme directory URI.
	 *
	 * @since 1.5.0
	 *
	 * @param string $template_dir_uri The URI of the active theme directory.
	 * @param string $template         Directory name of the active theme.
	 * @param string $theme_root_uri   The themes root URI.
	 */
	return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri );
}
```

## История изменений

- 1.5.0 — Introduced.

## Связанные

Использует: [`get_theme_root_uri`](https://chugunov.pro/api-wordpress/functions/get_theme_root_uri/), [`get_template`](https://chugunov.pro/api-wordpress/functions/get_template/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `WP_URL_Pattern_Prefixer::get_default_contexts`, `WP_REST_Themes_Controller::prepare_item_for_response`, [`get_parent_theme_file_uri`](https://chugunov.pro/api-wordpress/functions/get_parent_theme_file_uri/), [`get_theme_file_uri`](https://chugunov.pro/api-wordpress/functions/get_theme_file_uri/), [`get_editor_stylesheets`](https://chugunov.pro/api-wordpress/functions/get_editor_stylesheets/), `Custom_Image_Header::get_default_header_images`, `Custom_Image_Header::step_1`, `Custom_Image_Header::reset_header_image`, `Custom_Image_Header::process_default_headers`, `WP_Customize_Manager::register_controls`, [`_get_random_header_data`](https://chugunov.pro/api-wordpress/functions/_get_random_header_data/), [`get_custom_header`](https://chugunov.pro/api-wordpress/functions/get_custom_header/), [`get_theme_mod`](https://chugunov.pro/api-wordpress/functions/get_theme_mod/), [`get_bloginfo`](https://chugunov.pro/api-wordpress/functions/get_bloginfo/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/get_template_directory_uri/
