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 ‘[Fechado] Unlimited Elements Widget not translating correctly’ is closed to new replies.
Gerenciar o consentimento de cookies
Usamos cookies para otimizar nosso site e nossos serviços. Seu consentimento nos permite processar dados como o comportamento de navegação. O não consentimento pode afetar alguns recursos.
Funcional
Sempre ativo
Necessário para que nosso site funcione e se comunique corretamente.
Preferências
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Estatísticas
Nós os usamos para analisar as estatísticas do nosso site. As informações coletadas são totalmente anônimas. O armazenamento ou acesso técnico que é utilizado exclusivamente para fins estatísticos anônimos. Sem uma intimação, o cumprimento voluntário por parte do seu Provedor de Serviços de Internet, ou outros registros de terceiros, as informações armazenadas ou recuperadas para este propósito geralmente não podem ser usadas para identificá-lo.
Marketing
Esses cookies rastreiam sua navegação para fornecer anúncios relevantes para você.