在将WordPress更新到6.0.2之后,我看到了"死亡的白屏"--我只是说

有一个严重的错误

没有进一步的解释.

After some debugging I located the line, that produces the error:
/wp-content/plugins/jet-theme-core/includes/locations.php line 53

它是将数组赋给$this->_locations[ $id ]的类Jet_Theme_Core_Locations的函数

有了这些声明

private $_locations     = array();
public $test = array();
private $_test = array();

我测试了一些陈述,发现

$this->_locations = true;    // works
$this->_locations = "test";  // works
$this->_locations = array(); // works
$this->_locations = array("test");           // produces a critical error
$this->_locations = array("test" => "test"); // produces a critical error
$this->_locations[] = "test";                // produces a critical error
$this->_locations["test"] = "test";          // produces a critical error
$test = array("test" => "test"); // works
$this->test = array();           // works
$this->test = array("test");     // works
$this->_test = array();          // works
$this->_test = array("test");    // works

我一定是漏掉了什么.可能是很明显的事情.但我想不通,这是什么.

[编辑:] PHP日志(log)文件显示:

PHP Fatal error:  Uncaught Error: Class 'Elementor\\Post_CSS_File' not found in /wp-content/plugins/jet-theme-core/includes/locations.php:106

推荐答案

函数enqueue_styles()$this->_locations上循环并调用Elementor\Post_CSS_File,但没有找到它.如果$this->_locations为空或根本不是数组,则它不会触及Elementor\Post_CSS_File,也不会发生错误.

按照建议的here,我替换了

$css_file = new Elementor\Post_CSS_File( $template_id );

使用

$css_file = new Elementor\Core\Files\CSS\Post( $template_id );

现在一切都很好.

Php相关问答推荐

条纹 checkout :订阅试用版和额外付款(add_invoice_items)错误

提交表格后的重定向不起作用

如何在数据库中添加注册表单中的动态新行?

有条件的运费率基于购物车小计与WooPayments货币转换

如何修复条带元素中的错误&&客户端_机密&

在WooCommerce我的帐户部分添加带有自定义链接的自定义菜单项

将一个情态形式放在细丝v3中的形式中间

我必须对所有的SQL查询使用预准备语句吗?

只收取WooCommerce中最高的运费

在PHP 8.2 Gloogle云引擎上加载大型php文件速度缓慢

Laravel withOnly不限制查询

$this->;db->;update();CodIgnitor中的功能不工作

如何解决 Laravel 外键错误?

根据页面以及是否在促销,向 WooCommerce 中显示的价格添加前缀

添加或删除优惠券后自动刷新 WooCommerce checkout 表单字段

在 Laravel、Vuejs 和 Inertia 中配置 TypeScript 的问题

按前 3 列对二维数组中的行数据进行分组,然后用逗号连接每组中的其余列

PHP 中的正则表达式,具有字符范围,但不包括特定字符

自定义错误页面不适用于 Apache 和 nginx 设置的 .htaccess

如何从 PHP 中的字符串位置排除图像扩展名