WPML
상태
미해결
보고된 제품
Advanced Custom Fields Multilingual 2.1.3
관련 플러그인/테마
Advanced Custom Fields (ACF)
주제 태그
Compatibility

문제 개요

라디오 버튼 선택 항목이 있는 Advanced Custom Fields (ACF) 갤러리 블록이 포함된 페이지를 번역할 때, 이러한 라디오 선택 항목이 고급 번역 에디터(ATE)에 예기치 않게 표시됩니다.

임시 해결 방법

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


  • 테마의 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.

알려진 모든 문제 →