ภาพรวมของปัญหา
เมื่อใช้งาน Addon Elements for Elementor ร่วมกับ WPML คุณอาจพบปัญหาต่อไปนี้: เทมเพลตที่บันทึกไว้ซึ่งแสดงในวิดเจ็ต Content Switcher, Modal Popup, Dropbar หรือ Data Table ยังคงเป็นภาษาเริ่มต้นในหน้าที่แปลแล้ว
วิธีแก้ปัญหาชั่วคราว
เพิ่มโค้ดต่อไปนี้ลงในไฟล์ functions.php ของธีมลูกของคุณ:
PHP
add_filter( 'elementor/documents/get/post_id', function ( $id ) {
if ( 'elementor_library' === get_post_type( $id ) ) {
$id = apply_filters( 'wpml_object_id', $id, 'elementor_library', true );
}
return $id;
} );เมื่อใช้โค้ดนี้ วิดเจ็ต Content Switcher, Modal Popup, Dropbar และ Data Table จะแสดงเทมเพลตที่แปลแล้วในหน้าที่แปลแล้ว