_strip_template_file_suffix()WP 5.8.0

Strips .php or .html suffix from template file names.

Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.

Хуков нет.

Возвращает

Строку. Template file name without extension.

Использование

_strip_template_file_suffix( $template_file );
$template_file(строка) (обязательный)
Template file name.

Список изменений

С версии 5.8.0 Введена.

Код _strip_template_file_suffix() WP 6.5.2

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