首页 > 解决方案 > Wordpress 中的错误 - 升级 PHP 7.4 后的 elementor

问题描述

升级到 PHP 7.4 后,elemntor 开始报错

网址:www.aldon.ltd/ 云服务:GCP 服务器:Openlitespeed Wordpress Linux:Ubuntu 20.04 LTS

Notice: Trying to access array offset on value of type null in /var/www/html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 1449

注意:尝试访问第 1451 行 /var/www/html/wp-content/plugins/elementor/includes/base/controls-stack.php 中 null 类型值的数组偏移量

除了网页顶部显示的此通知外,所有其他功能均按预期工作。

导致错误的代码 /** * 结束控制部分。* * 用于关闭现有打开的控件部分。当您使用此方法时 * 它会停止向此部分添加新控件。** 这个方法应该用在_register_controls(). * * @since 1.4.0 * @access public */ 公共函数 end_controls_section() { $stack_name = $this->get_name();

            // Save the current section for the action.
            $current_section = $this->current_section;
            $section_id = $current_section['section'];
            $args = [
                    'tab' => $current_section['tab'],
            ];

/usr/local/lsws/logs/error.log 中的错误日志

PHP 注意: wp_deregister_script 被错误地调用。不要jquery-core在管理区域中取消注册脚本。要针对前端主题,请使用 wp_enqueue_scrip> PHP 注意:/var/www/html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 1449 PHP 注意:/var/www/第 1451 行的 html/wp-content/plugins/elementor/includes/base/controls-stack.php

标签: phpwordpresselementorlitespeedphp-7.4

解决方案


我解决了它作为临时解决方案。更改线路编号 1204 起

if ( $dynamic_property ) ) {

if ( $dynamic_property && isset($settings[ $control_name ][ $dynamic_property ]) ) {

推荐阅读