WPML
الحالة
محلولة
أُبلغ عنها لـ
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' )
    					);
    				}

جميع المشاكل المعروفة →