- 상태
- 개발자 대기 중
- 주제 태그
- Compatibility
문제 개요
WPML과 함께 eRecht24 legal texts for WordPress를 사용할 때, eRecht24 숏코드나 Elementor 위젯을 통해 추가된 법적 텍스트가 잘못된 언어로 표시될 수 있습니다. 이는 eRecht24 숏코드 또는 위젯 설정에서 언어를 설정해야 하기 때문에 발생할 수 있습니다.
여기서는 WPML 언어가 사용되지 않으므로, 번역을 수동으로 편집하여 숏코드나 위젯에서 올바른 언어를 선택해야 할 수 있습니다.
임시 해결 방법
진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.
- 테마의 functions.php 파일에 다음 코드를 추가하세요.
// WPML - Workaround for compsupp-8368 use the shortcode_atts_{$shortcode} filter to change 'lang' to the current language or fallback to English
add_filter( 'shortcode_atts_erecht24', function ( $out, $pairs, $atts, $shortcode ) {
if ( ! class_exists( 'SitePress' ) ) {
return $out;
}
$current_lang = apply_filters( 'wpml_current_language', null );
$out['lang'] = in_array( $current_lang, array( 'de', 'en' ), true ) ? $current_lang : 'en';
return $out;
}, 10, 4 );