# _strip_template_file_suffix()

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

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

## Сигнатура

```php
_strip_template_file_suffix( string $template_file ): string
```

## Описание

Удаляет суффикс .php или .html из имён файлов шаблонов.

## Параметры

- `$template_file` `string` — обязательный. Имя файла шаблона.

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

`string`

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

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

```php
function _strip_template_file_suffix( $template_file ) {
	return preg_replace( '/\.(php|html)$/', '', $template_file );
}
```

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

- 5.8.0 — Introduced.

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