_cleanup_header_comment

The timeline below displays how wordpress function _cleanup_header_comment has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Strips close comment and close php tags from file headers used by WP.
 *
 * @since 2.8.0
 * @access private
 *
 * @see https://core.trac.wordpress.org/ticket/8497
 *
 * @param string $str Header comment to clean up.
 * @return string
 */
function _cleanup_header_comment($str)
{
    return trim(preg_replace('/\s*(?:\*\/|\?>).*/', '', $str));
}

WordPress Version: 5.1

/**
 * Strip close comment and close php tags from file headers used by WP.
 *
 * @since 2.8.0
 * @access private
 *
 * @see https://core.trac.wordpress.org/ticket/8497
 *
 * @param string $str Header comment to clean up.
 * @return string
 */
function _cleanup_header_comment($str)
{
    return trim(preg_replace('/\s*(?:\*\/|\?>).*/', '', $str));
}

WordPress Version: 4.1

/**
 * Strip close comment and close php tags from file headers used by WP.
 *
 * @since 2.8.0
 * @access private
 *
 * @see https://core.trac.wordpress.org/ticket/8497
 *
 * @param string $str Header comment to clean up.
 * @return string
 */
function _cleanup_header_comment($str)
{
    return trim(preg_replace("/\\s*(?:\\*\\/|\\?>).*/", '', $str));
}

WordPress Version: 4.0

/**
 * Strip close comment and close php tags from file headers used by WP.
 *
 * @since 2.8.0
 * @access private
 *
 * @see http://core.trac.wordpress.org/ticket/8497
 *
 * @param string $str Header comment to clean up.
 * @return string
 */
function _cleanup_header_comment($str)
{
    return trim(preg_replace("/\\s*(?:\\*\\/|\\?>).*/", '', $str));
}

WordPress Version: 3.7

/**
 * Strip close comment and close php tags from file headers used by WP.
 * See http://core.trac.wordpress.org/ticket/8497
 *
 * @since 2.8.0
 *
 * @param string $str
 * @return string
 */
function _cleanup_header_comment($str)
{
    return trim(preg_replace("/\\s*(?:\\*\\/|\\?>).*/", '', $str));
}