WPML
Status
Resolved
Related plugin/theme
Elementor

Overview of the issue

If you have a Shortcode widget with some content in Elementor and translate the page using WPML’s translation editor, the Shortcode content will not be available for translation.

Workaround

We’re working on a fix for this issue. In the meantime you can fix it by adding this snippet of code to your theme functions.php file.

add_action('init', function (){
add_filter( 'wpml_elementor_widgets_to_translate', 'shortcode_widget_registration' );
});
 
/**
* Translate Shortcodes widget by elementor
* @param array $widgets
* @return array
*/
function shortcode_widget_registration($widgets) {
$widgets['shortcode'] = [
'conditions' => ['widgetType' => 'shortcode'],
'fields' => [
[
'field' => 'shortcode',
'type' => __('Enter your shortcode', 'sitepress'),
'editor_type' => 'AREA'
],
 
],
];
 
return $widgets;
}

Once you have done that, edit the page in the original language and then update the translation and you’ll find the Shortcode widget content available for translation.

All known issues →