This thread is resolved. Here is a description of the problem and solution.
Problem:
I can't translate the links of the social icons Elementor widgets.
Solution:
Please add this code to the functions.php file of your theme:
add_action('init', function (){ add_filter( 'wpml_elementor_widgets_to_translate', 'socialwidgetelementor' ); }); function socialwidgetelementor($widgets) { $widgets['social-icons'] = array( 'conditions' => array('widgetType' => 'social-icons'), 'fields' => array(), 'integration-class' => array( 'my_icons' ) ); return $widgets; } class my_icons extends WPML_Elementor_Module_With_Items { public function get_items_field() { return 'social_icon_list'; } public function get_fields() { return array( 'link' => array( 'url' ), ); } protected function get_title($field) { switch ($field) { case 'url': return __( 'Link', 'elementor' ); default: return ''; } } protected function get_editor_type($field) { switch ($field) { case 'url': return 'LINK'; default: return ''; } } }
and add again the Social Icons widget to the page.
Relevant Documentation:
https://wpml.org/documentation/plugins-compatibility/elementor/how-to-add-wpml-support-to-custom-elementor-widgets/#multiple-occurrences-of-the-same-field
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 10 replies, has 5 voices.
Last updated by 4 years, 2 months ago.
Assisted by: Radu.