- สถานะ
- แก้ไขแล้ว
- รายงานสำหรับ
- WPML Multilingual CMS 4.6.6
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- Divi
- แท็กหัวข้อ
- ATE, Compatibility
ภาพรวมของปัญหา
เมื่อใช้ธีม Divi คุณจะสังเกตเห็นว่าเมื่อข้อความของปุ่มที่มีเครื่องหมายอะพอสทรอฟีถูกแปลโดยใช้ WPML เครื่องหมายอะพอสทรอฟีจะแสดงเป็นเอนทิตี HTML
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าได้สำรองข้อมูลทั้งหมดของไซต์ของคุณก่อนดำเนินการต่อ
- เพิ่มโค้ดต่อไปนี้ลงในไฟล์ functions.php ของธีมของคุณ:
// WPML workaround for compsupp-7001 add_filter('do_shortcode_tag', 'wpml_compsupp7001_decode_et_pb_button_text', 10, 4); function wpml_compsupp7001_decode_et_pb_button_text($output, $tag, $attr, $m) { if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) { // Decode both the ampersand and the apostrophe $output = html_entity_decode($output, ENT_QUOTES, 'UTF-8'); } return $output; }
หมายเหตุ โปรดทราบว่าหากคุณกำลังใช้ปุ่ม Slider คุณจะต้องใช้บรรทัดนี้:
if ( class_exists('Sitepress') && 'et_pb_slide' === $tag && isset($attr['button_text'])) {แทน:
if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) {
และหากคุณกำลังใช้รายการ Accordion คุณจะต้องใช้บรรทัดนี้:
if ( class_exists('Sitepress') && 'et_pb_accordion_item' === $tag && isset($attr['title'])) {แทน:
if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) {
