- 상태
- 해결됨
- 해결된 버전
- 4.5.0
- 관련 플러그인/테마
- Houzez
문제 개요
Houzez 테마는 자체 사용자 정의 함수를 사용하여 테마 옵션을 호출합니다. 사이트의 기본 언어가 영어가 아닌 경우, 이 함수는 WPML과 충돌합니다. 그 결과 프런트엔드에 번역이 표시되지 않으며 관리 화면에서는 기본 언어로 되돌아갑니다.
임시 해결 방법
진행하기 전에 사이트를 전체 백업하세요.
- /wpml-string-translation/inc/admin-texts/wpml-admin-texts.class.php를 여세요.
- 198번째 줄을 찾으세요.
- 다음 코드를:
function icl_st_set_admin_options_filters() { $option_names = $this->getOptionNames(); foreach ( $option_names as $option_key => $option ) { if ( $this->is_blacklisted( $option_key ) ) { unset( $option_names[ $option_key ] ); update_option( '_icl_admin_option_names', $option_names ); } elseif ( $option_key != 'theme' && $option_key != 'plugin' ) { // theme and plugin are an obsolete format before 3.2 add_filter( 'option_' . $option_key, array( $this, 'icl_st_translate_admin_string' ) ); add_action( 'update_option_' . $option_key, array( $this, 'on_update_original_value' ), 10, 3 ); } } } - 다음과 같이 바꾸세요:
function icl_st_set_admin_options_filters() { $option_names = $this->getOptionNames(); $isAdmin = is_admin() && ! wpml_is_ajax(); foreach ( $option_names as $option_key => $option ) { if ( $this->is_blacklisted( $option_key ) ) { unset( $option_names[ $option_key ] ); update_option( '_icl_admin_option_names', $option_names ); } elseif ( $option_key != 'theme' && $option_key != 'plugin' ) { // theme and plugin are an obsolete format before 3.2 /** * We don't want to translate admin strings in admin panel because it causes a lot of confusion * when a value is displayed inside the form input. **/ if ( ! $isAdmin ) { add_filter( 'option_' . $option_key, array( $this, 'icl_st_translate_admin_string' ) ); } add_action( 'update_option_' . $option_key, array( $this, 'on_update_original_value' ), 10, 3 ); } } }
다음 단계
이 문제는 WPML 4.5(2021년 9월 말)가 릴리스되면 해결됩니다.