WPML

문제 개요

Divi 테마와 함께 WPML을 사용하여 번역을 100% 완료한 후에도 페이지가 번역된 것으로 표시되지 않는 문제가 발생할 수 있습니다. 또한 다음과 같은 오류가 기록될 수 있습니다:

PHP Fatal error:  Uncaught TypeError: htmlspecialchars_decode(): Argument #1 ($string) must be of type string, array given in .../wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php:203

임시 해결 방법

이 문제는 WPML 4.7에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.

진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.

  • …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php 파일을 여세요.
  • 206번째 줄을 찾으세요.
  • 다음을:
    if ( 'allow_html_tags' !== $encoding ) {
    	$translation = htmlspecialchars( htmlspecialchars_decode( $translation ) );
    }
  • 다음으로 변경하세요:
    // Ensure $translation is a string
    if (is_array($translation)) {
    	// Handle array to string conversion as needed
    	$translation = implode('', $translation);
    }
    
    if ( 'allow_html_tags' !== $encoding ) {
    	$translation = htmlspecialchars( htmlspecialchars_decode( $translation ) );
    }

모든 알려진 문제

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

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