WPML
สถานะ
แก้ไขแล้วโดยผู้พัฒนา
แก้ไขใน
Themify Ultra 8.0.1
ปลั๊กอิน/ธีมที่เกี่ยวข้อง
Themify Ultra
แท็กหัวข้อ
Compatibility

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

เมื่อแปลหน้าเว็บโดยใช้ WPML ร่วมกับโมดูล Feature Content ในธีม Themify Ultra ข้อความ ALT สำหรับรูปภาพจะไม่ได้รับการแปลในส่วนหน้าเว็บไซต์

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

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


  • เปิดไฟล์ …/wp-content/themes/themify-ultra/themify/themify-builder/classes/class-themify-builder-model.php

  • ค้นหาบรรทัดที่ 357

  • แทนที่:
        public static function get_alt_by_url(string $image_url):string {
            $attachment_id = themify_get_attachment_id_from_url($image_url);
            if ($attachment_id && ($alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true))) {
                return $alt;
            }
            return '';
        }
            


  • ด้วย:
        public static function get_alt_by_url(string $image_url):string {
            $attachment_id = themify_get_attachment_id_from_url($image_url);
            // WPML Workaround for wpmlsupp-12600
            if ( class_exists('Sitepress') ) { 
                $current_lang = apply_filters( 'wpml_current_language', NULL ); 
                $attachment_id = apply_filters( 'wpml_object_id', $attachment_id, 'post', TRUE, $current_lang ); 
            }
            if ($attachment_id && ($alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true))) {
                return $alt;
            }
            return '';
        }
            

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