Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save montrealist/a02e90b2f73e70846ec16858c42d03a9 to your computer and use it in GitHub Desktop.
Save montrealist/a02e90b2f73e70846ec16858c42d03a9 to your computer and use it in GitHub Desktop.
<?php
add_action('init', function () {
add_filter('wpml_elementor_widgets_to_translate', 'wpml_translate_widget_retina_image_20200714');
});
function wpml_translate_widget_retina_image_20200714($widgets)
{
$widgets['uael-marketing-button'] = [
'conditions' => ['widgetType' => 'uael-marketing-button'],
'fields' => [
[
'field' => 'text',
'type' => __('Title', 'uael'),
'editor_type' => 'AREA'
],
[
'field' => 'desc_text',
'type' => __('Description', 'uael'),
'editor_type' => 'AREA'
],
[
'field' => 'link',
'type' => __('Link', 'uael'),
'editor_type' => 'LINK'
]
]
];
// error_log('wpml_translate_widget_retina_image - $widgets[uael-marketing-button]:');
// error_log(print_r($widgets['uael-marketing-button'], true));
return $widgets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment