Search code examples
phpwordpresswordpress-themingelementor

Wordpress Elementor Pro post update Error


Iv recently been getting this error below, iv tried updating my plugins and theme one by one and the issue seems to happen after updating elementor or wordpress to the latest version. Im not sure what to do to fix this, currently I'm recoving a backup from before the update to add new content. Iv recently stopped paying for elementor pro and started using the free version could that course this issue?

Fatal error: Uncaught ReflectionException: Method get_site_editor_type does not exist in /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php:45 Stack trace: #0 /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php(45): ReflectionClass->getMethod('get_site_editor...') #1 /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php(126): ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document::get_site_editor_type_bc() #2 /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor/core/common/modules/finder/categories/create.php(94): ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document::get_create_url() #3 /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor/core/common/modules/finder/categories/create.php(67): Elementor in /home/customer/www/catalystcentral.com.au/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php on line 45


Solution

  • Solution 1:

    You also can simply comment out the line in /wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php. Line 46 was

    $method = $reflection->getMethod( 'get_site_editor_type' );
    

    Solution 2:

    Replace the code in your theme-document.php

    $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();
    }
    

    By

    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();
        }
    }
    

    Source