_strip_template_file_suffix( string $template_file ): string

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

Parameters

$template_filestringrequired
Template file name.

Return

string Template file name without extension.

Source

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

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.