_cleanup_header_comment()WP 2.8.0

Strips close comment and close php tags from file headers used by WP.

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.

Usage

_cleanup_header_comment( $str );
$str(string) (required)
Header comment to clean up.

Notes

Changelog

Since 2.8.0 Introduced.

_cleanup_header_comment() code WP 6.5.2

function _cleanup_header_comment( $str ) {
	return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
}