On this page
_cleanup_header_comment( string $str ): string
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. Use https://core.trac.wordpress.org/ticket/8497 instead.
Strips close comment and close php tags from file headers used by WP.
Description
See also
Parameters
$strstring Required-
Header comment to clean up.
Return
string
Source
File: wp-includes/functions.php. View all references
function _cleanup_header_comment( $str ) {
return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Theme::get_post_templates() wp-includes/class-wp-theme.php | Returns the theme’s post templates. |
| get_file_description() wp-admin/includes/file.php | Gets the description for standard WordPress theme files. |
| get_file_data() wp-includes/functions.php | Retrieves metadata from a file. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_cleanup_header_comment