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' )
    					);
    				}

כל התקלות הידועות →