之前解掉 Fatal error: Uncaught Error: Class 'Elementor\Scheme_Color' not found 的錯誤。殊不知製造另一個問題,變 Elementor 編輯區會一直轉圈圈無法載入,開啟 wp-debug 查原因,兇手是 Fatal error: Uncaught Error: Class ‘Elementor\Scheme_Color’ not found.
在 wp-content > mu-plugins 裡新增一個 schemefix.php。如果 wp-content 裡找不到 mu-plugins 資料夾,就自己建立。最後在 schemefix.php 貼上以下程式碼:
<?php
/**
* Plugin Name: Elementor Scheme_Color/Scheme_Typography Class Issue
**/
namespace Elementor;
add_action(
‘plugins_loaded’,
function() {
if ( ! class_exists( ‘Elementor\Scheme_Color’ ) ) {
class Scheme_Color extends Core\Schemes\Color {}
}
}
);
add_action(
‘plugins_loaded’,
function() {
if ( ! class_exists( ‘Elementor\Scheme_Typography ‘ ) ) {
class Scheme_Typography extends Core\Schemes\Typography {}
}
}
);
完成後儲存會像這樣:
回到管理後台,注意外掛的分類會多一個 [強制使用],就是強制執行 schemefix.php 這隻程式來跳過載入elementor Scheme_Color 或 Scheme_Typography,解決編輯區一直卡住無法載入的問題囉 😎
參考文章:WordPress error with Elementofatal-error-uncaught-error-class-elementorscheme_color-not-found