Panoramica del problema
Quando usi Addon Elements for Elementor con WPML, potresti riscontrare il seguente problema: un template salvato mostrato nel widget Content Switcher, Modal Popup, Dropbar o Data Table rimane nella lingua predefinita nelle pagine tradotte.
Soluzione alternativa
Aggiungi il seguente codice al file functions.php del tuo tema child:
PHP
add_filter( 'elementor/documents/get/post_id', function ( $id ) {
if ( 'elementor_library' === get_post_type( $id ) ) {
$id = apply_filters( 'wpml_object_id', $id, 'elementor_library', true );
}
return $id;
} );In questo modo, i widget Content Switcher, Modal Popup, Dropbar e Data Table mostrano il template tradotto nelle pagine tradotte.