# get_parent_theme_file_path()

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

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

## Сигнатура

```php
get_parent_theme_file_path( string $file = '' ): string
```

## Описание

Возвращает путь к файлу в родительской теме.

## Параметры

- `$file` `string` — необязательный, по умолчанию `''`. Файл, для которого нужно вернуть путь, в каталоге шаблона.

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

`string`

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

Файл: `wp-includes/link-template.php:4743`

```php
function get_parent_theme_file_path( $file = '' ) {
	$file = ltrim( $file, '/' );

	if ( empty( $file ) ) {
		$path = get_template_directory();
	} else {
		$path = get_template_directory() . '/' . $file;
	}

	/**
	 * Filters the path to a file in the parent theme.
	 *
	 * @since 4.7.0
	 *
	 * @param string $path The file path.
	 * @param string $file The requested file to search for.
	 */
	return apply_filters( 'parent_theme_file_path', $path, $file );
}
```

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

- 4.7.0 — Introduced.

## Связанные

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

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