php - 我的 Elementor 网站面临致命错误致命错误:必须保护 Molla_Element_Section::get_html_tag() 的访问级别
问题描述
我的网站显示的错误如下:
致命错误:Molla_Element_Section::get_html_tag() 的访问级别必须受到保护(如 Elementor\Element_Section 类)或 web.com/public_html/wp-content/plugins/molla-core/elementor/elements/section.php 中的较弱第 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 文档中的 Object Inheritance:方法、属性和常量的可见性可以放宽,例如可以将受保护的方法标记为公共,但不能限制它们,例如将公共属性标记为私有。
Molla_Element_Section 类很可能继承自 Elementor\Element_Section 并覆盖方法 get_html_tag。但它使用了错误的访问级别。get_html_tag 方法不能是“私有的”,它必须是“受保护的”或“公共的”。正如文件所说,可见性不能受到限制。
推荐阅读
- javascript - 接收来自 Express.js sendFile() 的响应是损坏的 PDF
- asp.net - 从服务器接收结果时发生传输级错误。(提供者:TCP 提供者,错误:0 - 成功)
- typescript - 解构由另一个泛型制成的泛型类型
- elasticsearch - 在具有单个 must/should/must_not 的查询中需要“bool”吗?
- javascript - 将值附加到 LocalStorage
- python - 使用数据框转换文本文件
- google-analytics - 如何在 Google Analytics 中设置 Google Workspace Marketplace 应用列表事件跟踪
- mysql - 如何按此表分组?
- pyspark - 在 Pyspark 中将多行组合为 JSON 对象
- python - 解析由多个 JSON 对象组成的字符串一起运行