_strip_template_file_suffix()WP 5.8.0

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

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String. Template file name without extension.

Usage

_strip_template_file_suffix( $template_file );
$template_file(string) (required)
Template file name.

Changelog

Since 5.8.0 Introduced.

_strip_template_file_suffix() code WP 6.5.2

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