WPML
상태
해결됨
보고된 제품
WPML Multilingual CMS 4.6.12
해결된 버전
WPML 4.7
관련 플러그인/테마
Divi
주제 태그
Compatibility

문제 개요

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

임시 해결 방법

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


  • …/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 ) );
    		}

알려진 모든 문제 →