- สถานะ
- เปิด
- รายงานสำหรับ
- Advanced Custom Fields Multilingual 2.1.3
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- Advanced Custom Fields (ACF)
- แท็กหัวข้อ
- Compatibility
ภาพรวมของปัญหา
เมื่อแปลหน้าที่มี บล็อกแกลเลอรี ของ Advanced Custom Fields (ACF) ที่มีตัวเลือกแบบ radio button ตัวเลือก radio เหล่านี้จะปรากฏขึ้นอย่างไม่คาดคิดใน ตัวแก้ไขการแปลขั้นสูง (ATE)
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าได้สำรองข้อมูลไซต์ทั้งหมดของคุณก่อนดำเนินการต่อ
- เปิดไฟล์ functions.php ของธีมของคุณ
- เพิ่มโค้ดต่อไปนี้:
// WPML Workaround for compsupp-7404 add_filter( 'wpml_found_strings_in_block', function( array $strings, WP_Block_Parser_Block $block ) { $isInBlacklistedStrings = function( string $fieldName ) { // Add the fields to ignore here $fieldsToIgnore = []; $fieldsToIgnore[] = 'gallery_section_type'; $fieldsToIgnore[] = 'gallery_section_variant'; if ( in_array($fieldName, $fieldsToIgnore) ) { return true; } return false; }; if ( $block->blockName == 'acf/gallery' ) { foreach( $block->attrs['data'] as $fieldName => $string ) { if ( $isInBlacklistedStrings( $fieldName ) ) { unset( $block->attrs['data'][ $fieldName ] ); } } } return $strings; }, 9, 2 ); // Lower priority than 10.