نظرة عامة على المشكلة
قد لا تعمل ترجمة الصور باستخدام WPML Media Translation كما هو متوقع للصور المدرجة في الوصف القصير لمنتج WooCommerce. قد تلاحظ أنه على الرغم من ترجمة الصورة، فإنها لا تظهر في النسخة المترجمة من الوصف القصير للمنتج.
حل بديل مؤقت
تم إصلاح هذه المشكلة في WPML 4.7.2. يحل التحديث المشكلة على موقعك، لذا لا تحتاج إلى هذا الحل البديل المؤقت إلا إذا لم تتمكن من التحديث بعد.
يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح الملف …/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' ) ); }