문제 개요
라디오 버튼 선택 항목이 있는 Advanced Custom Fields (ACF) 갤러리 블록이 포함된 페이지를 번역할 때, 이러한 라디오 선택 항목이 고급 번역 에디터(ATE)에 예기치 않게 표시됩니다.
임시 해결 방법
이 문제는 ACFML 5.0.0에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.
ACFML 5.0 이상으로 업데이트한 다음, 필드 그룹에서 라디오 필드를 복사로 설정하세요. 그러면 실제 텍스트만 자동 번역으로 전송됩니다.
아직 업데이트할 수 없는 경우:
진행하기 전에 전체 사이트 백업을 수행했는지 확인하세요.- 테마의 functions.php 파일을 여세요.
- 다음 코드를 추가하세요:
// WPML Workaround for compsupp-7404 add_filter( 'wpml_found_strings_in_block', function( array $strings, WP_Block_Parser_Block $block ) { $isInBlacklistedStrings = function( string $fieldName ) { // Add the fields to ignore here $fieldsToIgnore = []; $fieldsToIgnore[] = 'gallery_section_type'; $fieldsToIgnore[] = 'gallery_section_variant'; if ( in_array($fieldName, $fieldsToIgnore) ) { return true; } return false; }; if ( $block->blockName == 'acf/gallery' ) { foreach( $block->attrs['data'] as $fieldName => $string ) { if ( $isInBlacklistedStrings( $fieldName ) ) { unset( $block->attrs['data'][ $fieldName ] ); } } } return $strings; }, 9, 2 ); // Lower priority than 10.