_cleanup_header_comment() – Function | Developer.WordPress.org (original) (raw)

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 ) );
}

View all references View on Trac View on GitHub

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.