- สถานะ
- แก้ไขแล้ว
- รายงานสำหรับ
- WPML Media Translation 2.7.3
- แก้ไขใน
- WPML 4.7.2
- แท็กหัวข้อ
- Bug
ภาพรวมของปัญหา
การแปลรูปภาพโดยใช้ WPML Media Translation อาจไม่ทำงานตามที่คาดไว้สำหรับรูปภาพที่แทรกลงในคำอธิบายอย่างย่อของสินค้า WooCommerce คุณอาจพบว่าแม้จะแปลรูปภาพแล้ว แต่รูปภาพนั้นไม่ปรากฏในคำอธิบายอย่างย่อของสินค้าฉบับแปล
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าคุณได้สำรองข้อมูลทั้งหมดของไซต์ของคุณก่อนดำเนินการต่อ
- เปิดไฟล์ …/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php
- ค้นหาบรรทัดที่ 146
- แทนที่:
if ( $post_content_filtered !== $post->post_content ) { $this->wpdb->update( $this->wpdb->posts, array( 'post_content' => $post_content_filtered ), array( 'ID' => $post->ID ), array( '%s' ), array( '%d' ) ); } - ด้วย:
if ( $post_content_filtered !== $post->post_content ) { $this->wpdb->update( $this->wpdb->posts, array( 'post_content' => $post_content_filtered ), array( 'ID' => $post->ID ), array( '%s' ), array( '%d' ) ); } $post_excerpt_filtered = $this->images_updater->replace_images_with_translations( $post->post_excerpt, $post_element->get_language_code(), $post_element->get_source_language_code() ); if ( $post_excerpt_filtered !== $post->post_excerpt ) { $this->wpdb->update( $this->wpdb->posts, array( 'post_excerpt' => $post_excerpt_filtered ), array( 'ID' => $post->ID ), array( '%s' ), array( '%d' ) ); }