Hi @johnmagna
I’m not sure, It maybe Cannot use $this Outer object.
raindrops_wp_headers() function filtered add_filter( 'wp_headers', 'raindrops_wp_headers', 10, 2 );//hooks.php line:175
Core wp-includes/class-wp.php line:473
/**
* Filters the HTTP headers before they're sent to the browser.
*
* @since 2.8.0
*
* @param array $headers The list of headers to be sent.
* @param WP $this Current WordPress environment instance.
*/
$headers = apply_filters( 'wp_headers', $headers, $this );
I do not have the environment of PHP 7.1 so please try it
functions.php add below code.
<?php
/////////// ADD FUNCTION ////////////////////
function raindrops_wp_headers( $headers ) {
global $raindrops_xhtml_media_type;
/**
* xhtml media type
* value 'application/xhtml+xml' or 'text/html'
*/
if ( !isset( $raindrops_xhtml_media_type ) ) {
$raindrops_xhtml_media_type = raindrops_warehouse_clone( 'raindrops_xhtml_media_type' );
}
if ( !is_admin() && !is_user_logged_in() && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) && $raindrops_xhtml_media_type == 'application/xhtml+xml' ) {
$headers[ "Content-Type" ] = $raindrops_xhtml_media_type . '; charset=' . get_bloginfo( 'charset' );
add_filter( 'option_html_type', 'raindrops_xhtml_media_type', 10 );
}
return $headers;
}
///////////// END ///////////////////////////
/**
*
*
* @package Raindrops
* @since Raindrops 0.1
*/
if ( !defined( 'ABSPATH' ) ) {
exit;
}
hooks.php change parameter
/**
* @since 1.261
*/
add_filter( 'wp_headers', 'raindrops_wp_headers', 10, 2 );
/**
* @since 1.270
*/
Change below remove 2 parameter
/**
* @since 1.261
*/
add_filter( 'wp_headers', 'raindrops_wp_headers', 10 );
/**
* @since 1.270
*/
Once the problem is resolved, include it in the change in the next version, so please tell us the result
Above code test result with PHP PHP Version 7.0.10
DOCUMENT TYPE XHTML + XHTML Media Type header controll : PASS
Content-Type: application/xhtml+xml; charset=UTF-8
Content-Type: text/html; charset=UTF-8
Thank you.