Facing Fatal error with my Elementor website Fatal error: Access level to Molla_Element_Section::get_html_tag() must be protected

Facing Fatal error with my Elementor website Fatal error: Access level to Molla_Element_Section::get_html_tag() must be protected

我的网站显示的错误如下:

Fatal error: Access level to Molla_Element_Section::get_html_tag() must be protected (as in class Elementor\Element_Section) or weaker in web.com/public_html/wp-content/plugins/molla-core/elementor/elements/section.php on line 3668

根据上面的目录,第 3668 行的代码如下:

/**
 * Get HTML tag.
 *
 * Retrieve the section element HTML tag.
 *
 * @since 1.0
 */
private function get_html_tag() {
    $html_tag = $this->get_settings( 'html_tag' );

    if ( empty( $html_tag ) ) {
        $html_tag = 'section';
    }

    return $html_tag;
}

请帮我解决这个问题,我试过玩 elementor 版本(降级以检查是否是这个问题)但没有帮助。

查看 php 文档中的对象继承: 可以放宽方法、属性和常量的可见性,例如受保护的方法可以标记为 public,但它们不能被限制,例如将 public 属性 标记为私有。

很可能 Molla_Element_Section class 继承自 Elementor\Element_Section 并覆盖方法 get_html_tag。但它使用了错误的访问级别。 get_html_tag 方法不能是 'private',它必须是 'protected' 或 'public'。正如文档所说,不能限制可见性。

所以我继续将 Elementor 版本回滚到 3.3.1。目前,一切运行稳定,临时解决方案似乎运行良好。如果您遇到同样的问题,请按照以下步骤降级 Elementor。

登录到 WP-Dashboard > Elementor > 工具 > 版本控制并将版本回滚到 3.3.1

点击“保存”并确保清除浏览器缓存。 您现在应该得到一个可以正常工作的网站!