WPML

ภาพรวมของปัญหา

หากคุณกำลังแปลเว็บไซต์ที่สร้างด้วยธีม Divi แต่กำลังใช้สิทธิ์การใช้งาน WPML Multilingual Blog คุณจะพบข้อผิดพลาดต่อไปนี้เมื่อพยายามสร้างหน้าใหม่:

PHP Fatal error: Uncaught Error: Undefined constant “WPML_TM_FOLDER” in …\wp-content\plugins\sitepress-multilingual-cms\addons\wpml-page-builders\classes\Integrations\Divi\TinyMCE.php:21

Stack trace:

#0 …\wp-content\plugins\sitepress-multilingual-cms\addons\wpml-page-builders\classes\Integrations\Divi\TinyMCE.php(21): constant('WPML_TM_FOLDER’)

#1 …\wp-includes\class-wp-hook.php(309): WPML\Compatibility\Divi\TinyMCE->filterEditorAutoTags(Array)

#2 …\wp-includes\plugin.php(191): WP_Hook->apply_filters(Array, Array)

#3 …\wp-includes\script-loader.php(560): apply_filters('tiny_mce_before…', Array, ‘classic-block’)

#4 ….\wp-admin\edit-form-blocks.php(252): wp_tinymce_inline_scripts()

#5 …\wp-admin\post-new.php(72): require('C:\\xampp8\\htdoc…')

#6 {main}

thrown in …\wp-content\plugins\sitepress-multilingual-cms\addons\wpml-page-builders\classes\Integrations\Divi\TinyMCE.php on line 21

วิธีแก้ปัญหาชั่วคราว

ปัญหานี้ได้รับการแก้ไขแล้ว การอัปเดตเป็นเวอร์ชันล่าสุดจะแก้ปัญหานี้บนไซต์ของคุณ ดังนั้นคุณจึงต้องใช้วิธีแก้ปัญหาชั่วคราวนี้เฉพาะในกรณีที่คุณยังไม่สามารถอัปเดตได้

โปรดตรวจสอบให้แน่ใจว่าคุณได้สำรองข้อมูลทั้งหมดของเว็บไซต์ของคุณ:

  1. เปิดไฟล์ /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/TinyMCE.php
  2. ค้นหาบรรทัดที่ 9
  3. แทนที่:
    PHP
    public function add_hooks() {
        add_filter( 'tiny_mce_before_init', [ $this, 'filterEditorAutoTags' ] );
    }
    ด้วย:
    PHP
    public function add_hooks() {
        if ( defined( 'WPML_TM_FOLDER' ) ) {
            add_filter( 'tiny_mce_before_init', [ $this, 'filterEditorAutoTags' ] );
        }
    }

ปัญหาที่ทราบแล้วทั้งหมด

ยังคงพบปัญหานี้อยู่หรือไม่

หากการอัปเดตไม่สามารถแก้ไขปัญหานี้ได้ ส่งคำถามถึงฝ่ายสนับสนุน และเราจะตรวจสอบร่วมกับคุณ