Background of the issue:
I recently had contact with Kor - one of your supporters. However, I have no email chain and all was online, first via chat. I also can not locate the support thread. I had a problem with an Unlimited Elements widget - Kor did some faultfinding and then sent the issue to second tier support and came back with some code to add to our functions.php folder. It works and now translates and appears in the secondary language instead of being overwritten on the next ATE save. This is the code supplied by Kor:
// WPML Workaround for compsupp-7445
add_filter( 'elementor/frontend/before_render', 'wpml_compsupp7445_filter_ucaddon_post_grid');
function wpml_compsupp7445_filter_ucaddon_post_grid($element) {
if ( 'ucaddon_post_grid' !== $element->get_name() ) {
return;
}
$settings = $element->get_settings();
if ( isset( $settings['post_list_manual_select_post_ids'] ) && is_array( $settings['post_list_manual_select_post_ids'] ) ) {
foreach ( $settings['post_list_manual_select_post_ids'] as $key => $id ) {
if (isset($settings['post_list_manual_post_ids_dynamic'])) {
// Check if the IDs are in a string and convert them to an array
if (is_string($settings['post_list_manual_post_ids_dynamic'])) {
$settings['post_list_manual_post_ids_dynamic'] = explode(',', $settings['post_list_manual_post_ids_dynamic']);
}
// Proceed only if it's an array
if (is_array($settings['post_list_manual_post_ids_dynamic'])) {
foreach ($settings['post_list_manual_post_ids_dynamic'] as $key => $id) {
$post_type = get_post_type($id);
if (!$post_type) {
continue;
}
$translated_id = apply_filters('wpml_object_id', $id, $post_type, true);
$settings['post_list_manual_post_ids_dynamic'][$key] = $translated_id;
}
$element->set_settings('post_list_manual_post_ids_dynamic', $settings['post_list_manual_post_ids_dynamic']);
}
}
}
Symptoms:
One part of the Unlimited Elements widget is not being translated - it appears in English (the primary language) for all translated languages.
In the Post Grid Widget, this part is called the 'Intro'.
Questions:
if the change/correction to the code could be made to also display this filed in the translated language then all will be working perfectly 🙂
If Kor is available, maybe it would be helpful as he is recently familiar with the issue.
The topic ‘[Cerrado] Unlimited Elements Widget not translating correctly’ is closed to new replies.
Gestionar el consentimiento de cookies
Utilizamos cookies para optimizar nuestro sitio web y nuestros servicios. Su consentimiento nos permite procesar datos como el comportamiento de navegación. No dar su consentimiento puede afectar a algunas funciones.
Funcional
Siempre activo
Necesario para que nuestro sitio web funcione y se comunique correctamente.
Preferencias
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Estadísticas
Las utilizamos para analizar las estadísticas de nuestro sitio. La información recopilada es totalmente anónima.El almacenamiento o acceso técnico que se utiliza exclusivamente con fines estadísticos anónimos. Sin una citación, el cumplimiento voluntario por parte de su proveedor de servicios de Internet, u otros registros de terceros, la información almacenada o recuperada solo para este propósito generalmente no puede usarse para identificarlo.
Marketing
Estas cookies rastrean su navegación para proporcionar anuncios relevantes para usted.