我做了一些研究来解决这个问题,但是似乎对我不起作用,我已经检查了所有间距,替换了原始的functions.php,仔细检查了wp-config.php,但仍然对我不起作用。我使用的是wordpress 5.4版本,在安装Elementor Pro并插入WP-Filebase短代码后,错误消息出现。
警告:无法修改标题信息-/ home /中已经发送过的标题(输出从/home/customer/www/xxx.xxx/public_html/xxx/wp-includes/class.wp-scripts.php:405开始)第9行的customer / www / xxx.xxx / public_html / xxx / wp-admin / admin-header.php>
这里是第405行的class.wp-scripts.php
* Filters the HTML script tag of an enqueued script.
*
* @since 4.1.0
*
* @param string $tag The `<script>` tag for the enqueued script.
* @param string $handle The script's registered handle.
* @param string $src The script's source URL.
*/
$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );
if ( $this->do_concat ) {
$this->print_html .= $tag;
} else {
echo $tag;
}
return true;
}
这里是第9行的admin-header.php
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
if ( ! defined( 'WP_ADMIN' ) ) {
require_once __DIR__ . '/admin.php';
}
肮脏的廉价解决方案,在标题部分添加@。
@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );