elementor_rest_field' ] ); add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_assets' ] ); add_action( 'admin_footer', [ $this, 'print_admin_js_template' ] ); add_action( 'wp_enqueue_scripts', [ $this, 'dequeue_assets' ], 999 ); } public function dequeue_assets() { if ( ! static::is_optimized_gutenberg_loading_enabled() ) { return; } if ( ! static::should_dequeue_gutenberg_assets() ) { return; } wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style( 'wp-block-library-theme' ); wp_dequeue_style( 'wc-block-style' ); wp_dequeue_style( 'wc-blocks-style' ); } /** * Check whether the "Optimized Gutenberg Loading" settings is enabled. * * The 'elementor_optimized_gutenberg_loading' option can be enabled/disabled from the Elementor settings. * For BC, when the option has not been saved in the database, the default '1' value is returned. * * @since 3.21.0 * @access private */ private static function is_optimized_gutenberg_loading_enabled() : bool { return (bool) get_option( 'elementor_optimized_gutenberg_loading', '1' ); } private static function should_dequeue_gutenberg_assets() : bool { $post = get_post(); if ( empty( $post->ID ) ) { return false; } if ( ! static::is_built_with_elementor( $post ) ) { return false; } if ( static::is_gutenberg_in_post( $post ) ) { return false; } return true; } private static function is_built_with_elementor( $post ) : bool { $document = Plugin::$instance->documents->get( $post->ID ); if ( ! $document || ! $document->is_built_with_elementor() ) { return false; } return true; } private static function is_gutenberg_in_post( $post ) : bool { if ( has_blocks( $post ) ) { return true; } if ( static::current_theme_is_fse_theme() ) { return true; } return false; } private static function current_theme_is_fse_theme() : bool { if ( function_exists( 'wp_is_block_theme' ) ) { return (bool) wp_is_block_theme(); } if ( function_exists( 'gutenberg_is_fse_theme' ) ) { return (bool) gutenberg_is_fse_theme(); } return false; } }
Fatal error: Uncaught Error: Class "Elementor\Modules\Gutenberg\Module" not found in /htdocs/wp-content/plugins/elementor/core/modules-manager.php:53 Stack trace: #0 /htdocs/wp-content/plugins/elementor/includes/plugin.php(757): Elementor\Core\Modules_Manager->__construct() #1 /htdocs/wp-content/plugins/elementor/includes/plugin.php(674): Elementor\Plugin->init_components() #2 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('') #3 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #4 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /htdocs/wp-settings.php(700): do_action('init') #6 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #7 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #8 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #9 /htdocs/index.php(17): require('/htdocs/wp-blog...') #10 {main} thrown in /htdocs/wp-content/plugins/elementor/core/modules-manager.php on line 53