W3cubDocs

/WordPress

_cleanup_header_comment( string $str ): string

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

Description

See also

Parameters

$strstringrequired
Header comment to clean up.

Return

string

Source

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

Changelog

Version Description
2.8.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_cleanup_header_comment