群里vip用户反应了一个Elementor插件的报错问题,是在更新WordPress v6.1版本后出现的,在这里做个记录。
报错内容
Fatal error: Uncaught ReflectionException: Method get site editor_type does not exist in /wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php on line 47

解决办法
1、手动上传最新版的elementor插件和elementor pro插件到/wp-content/plugins/目录下解压覆盖。
2、查看问题是否解决,如果没有解决,则尝试下面的方法。
3、找到 /wp-content/plugins/elementor-pro/modules/theme-builder/documents/ 目录下的 theme-document.php文件,并打开编辑模式。
4、找到下面代码
$reflection = new \ReflectionClass( $class_name ); //约为45行
$method = $reflection->getMethod( 'get_site_editor_type' );
// It's own method, use it.
if ( $class_name === $method->class ) {
return static::get_site_editor_type();
}
修改为下面这样,然后保存。
if (method_exists($class_name, "get_site_editor_type")) {
$reflection = new \ReflectionClass( $class_name );
$method = $reflection->getMethod( 'get_site_editor_type' );
// It's own method, use it.
if ( $class_name === $method->class ) {
return static::get_site_editor_type();
}
}
5、查看报错是否消失,消失的话问题就解决了,如果上面办法都不行,请在下面评论反馈。
方法2来源于:这里

评论0 注意:评论区不审核也不处理售后问题!如有售后问题请前往用户中心提交工单以详细说明!