|
The Social Icon widget link is not available in ATE
Iniziato da: reneB-22
in: English Support
Soluzione rapida disponibile
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
|
|
5 |
12 |
4 anno, 2 mese fa
reneB-22
|