在网站上什么都不做,几天后不使用,当尝试登录时,会出现这样的错误:
Fatal error: Uncaught ReflectionException: Method get_site_editor_type does not exist in /usr/home/midas/domains/mydomain.com/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php:45
theme-document.php:
protected static function get_site_editor_type_bc() {
static $types = [];
$class_name = static::get_class_full_name();
$reflection = new ReflectionClass( $class_name ); //45 line
$method = $reflection->getMethod( 'get_site_editor_type' );
// It's own method, use it.
if ( $class_name === $method->class ) {
return static::get_site_editor_type();
}
// _deprecated_function( 'get_name', '3.0.0', 'get_site_editor_type' );
// Fallback, get from class instance name (with caching).
if ( isset( $types[ $class_name ] ) ) {
return $types[ $class_name ];
}
$instance = new static();
$types[ $class_name ] = $instance->get_name();
return $types[ $class_name ];
}
我该如何解决此问题?
更改代码
$reflection = new ReflectionClass( $class_name ); //45 line
$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();
}
}
我与Mayous类似地解决了这个问题。我只是简单地注释掉了/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php
中的行。所以第46行是
$method = $reflection->getMethod( 'get_site_editor_type' );
将其更改为
//$method = $reflection->getMethod( 'get_site_editor_type' );
转到:/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php
注释第47行
$method = $reflection->getMethod( 'get_site_editor_type' );
等待修复程序更新。
我今天也遇到了这个问题,并通过回滚免费版本的Elementor解决了它,这是由于最近更新中的一个错误造成的。
在我的案例中,管理员(已登录的用户(的网站崩溃了,因此无法登录。
我的解决方案是关闭";Elementor pro";(使用我的wp主机的管理控制台(,然后我可以登录并手动上传Elementorpro的新版本。
由于没有办法禁用插件,我想编辑代码也可以,只需注释掉中的第47行即可
/wp-content/plugins/eelementor-pro/modules/themebuilder/documents/theme-document.php