Resolved
Reported for: WPML Multilingual CMS 4.5.10
Resolved in: 4.5.11
Overview of the issue
If you translate images from any page builder, such as Divi, Avada, WPBakery, Enfold, etc. using the WPML Media Translation plugin, it will display always images in the default language.
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/media/shortcodes/class-wpml-page-builders-media-shortcodes-update.php file.
- Look for line 42.
- Replace:
$this->media_usage->update( $element->get_source_element()->get_id() );
With:
$this->media_usage->update( $element->get_source_element()->get_id() ); $tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); $postarr = array( 'ID' => $post->ID, 'post_content' => $post->post_content, 'tags_input' => $tag_ids, ); kses_remove_filters(); wpml_update_escaped_post( $postarr ); kses_init();
- After adding the code, you may need to refresh your translation in order to obtain the translated image.