_strip_template_file_suffix()WP 5.8.0

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

This is an internal function for using it by WP core itself. It's 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.

Code of _strip_template_file_suffix() WP 6.0.2

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