WPML

문제 개요

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

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.