# _get_block_templates_paths()

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

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

## Сигнатура

```php
_get_block_templates_paths( string $base_directory ): string[]
```

## Описание

Находит пути ко всем вложенным файлам частей шаблонов в каталоге темы.

## Параметры

- `$base_directory` `string` — обязательный. Путь к файлам темы.

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

`string[]`

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

Файл: `wp-includes/block-template-utils.php:297`

```php
function _get_block_templates_paths( $base_directory ) {
	static $template_path_list = array();
	if ( isset( $template_path_list[ $base_directory ] ) ) {
		return $template_path_list[ $base_directory ];
	}
	$path_list = array();
	if ( is_dir( $base_directory ) ) {
		$nested_files      = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_directory ) );
		$nested_html_files = new RegexIterator( $nested_files, '/^.+\.html$/i', RecursiveRegexIterator::GET_MATCH );
		foreach ( $nested_html_files as $path => $file ) {
			$path_list[] = $path;
		}
	}
	$template_path_list[ $base_directory ] = $path_list;
	return $path_list;
}
```

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

- 5.9.0 — Introduced.

## Связанные

Используется в: [`_get_block_templates_files`](https://chugunov.pro/api-wordpress/functions/_get_block_templates_files/).

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