ข้ามไปยังเนื้อหาหลัก ข้ามไปยังแถบด้านข้าง

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>