콘텐츠로 건너뛰기 사이드바로 건너뛰기

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the “Advanced Gallery” block from Kadence Blocks with WPML, media added to the gallery cannot be translated via the Media Translation module. Translated images do not appear on the secondary language pages.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/kadence-blocks/includes/blocks/class-kadence-blocks-advancedgallery-block.php file.
  • Replace:
    $image_id = ( ! empty( $image['id'] ) ? $image['id'] : '' );
            
  • With:
    $image_id = ( ! empty( $image['id'] ) ? apply_filters( 'wpml_media_id', $image['id'] ) : '' );
            
  • Replace:
    $image_src  = ( ! empty( $image['thumbUrl'] ) ? $image['thumbUrl']  : $image['url']  );
            
  • With:
    $image_src  = ( ! empty( $image['thumbUrl'] ) ? apply_filters( 'wpml_media_url', $image['thumbUrl'] ) : apply_filters( 'wpml_media_url', $image['url'] ) );
            

답글 남기기

주제에 집중하고 다른 사람을 존중해 주세요. 이 게시물과 관련 없는 문제에 도움이 필요하면 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하세요.

다음 태그를 사용할 수 있습니다:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>