WPML
Stato
Risolto dall’autore
Plugin/tema correlato
The Plus Addons for Elementor
Tag dell’argomento
Compatibility, Elementor Custom Widgets

Panoramica del problema

Quando usi The Plus Addons for Elementor Pro, il contenuto all’interno del widget Tabs non viene tradotto.

Soluzione alternativa

Assicurati di avere un backup completo del sito prima di procedere.


  • Apri il file functions.php del tuo tema.
    add_filter('elementor/frontend/before_render', 'wpml_compsupp7837_filter_loop_grid_widget');
    
    function wpml_compsupp7837_filter_loop_grid_widget($element) {
        if ('tp-tabs-tours' !== $element->get_name()) {
            return $element;
        }
    
        $settings = $element->get_settings();
    
        if (!isset($settings['tabs']) || !is_array($settings['tabs'])) {
            return $element;
        }
    
        $tabs = $settings['tabs'];
    
        foreach ($tabs as $key => $value) {
            if (empty($value['content_template']) || !is_numeric($value['content_template'])) {
                continue;
            }
            // Use apply_filters to adjust template_id for WPML
            $id = apply_filters('wpml_object_id', $value['content_template'], get_post_type($value['content_template']), true);
            if (!is_numeric($id)) {
                continue;
            }
            $tabs[$key]['content_template'] = $id;
        }
    
    
        $settings['tabs'] = $tabs;
        $element->set_settings('tabs', $settings['tabs']);
    }
            

Tutti i problemi noti →