[英]Warning: Cannot modify header information - Wordpress
I did some research to solve this problem, but seems like not working for me, I have checked all the spacing, replaced original functions.php, double check wp-config.php but still not working for me.我做了一些研究来解决这个问题,但似乎对我不起作用,我检查了所有间距,替换了原始函数。php,仔细检查 wp-config.php 但仍然不适合我。 Im using wordpress 5.4 version, after I installed Elementor Pro and insert WP-Filebase shortcode, the error message showing up.
我使用 wordpress 5.4 版本,安装 Elementor Pro 并插入 WP-Filebase 短代码后,出现错误消息。
Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/xxx.xxx/public_html/xxx/wp-includes/class.wp-scripts.php:405) in /home/customer/www/xxx.xxx/public_html/xxx/wp-admin/admin-header.php on line 9>
警告:无法修改 header 信息 - 已发送的标头(输出开始于 /home/customer/www/xxx.xxx/public_html/xxx/wp-includes/class.wp-scripts.php:405)在 /home/customer/ www/xxx.xxx/public_html/xxx/wp-admin/admin-header.php 在第 9 行>
Here is the class.wp-scripts.php on line 405这是第 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;
}
Here is the admin-header.php on line 9这是第 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';
}
Dirty cheap solution, add @ in the header section.肮脏的廉价解决方案,在 header 部分添加@。
@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.