Alert: 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.

_cleanup_header_comment() WordPress Function

The cleanup_header_comment() function is used to clean up the header comment in a WordPress file. This function is called by the wp-admin/includes/file.php file when a WordPress file is saved.

_cleanup_header_comment( string $str ) #

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


Description

Top ↑

See also


Top ↑

Parameters

$str

(string)(Required)Header comment to clean up.


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/functions.php

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


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More