WPML
상태
개발자가 해결함
관련 플러그인/테마
The Plus Addons for Elementor
주제 태그
Compatibility, Elementor Custom Widgets

문제 개요

The Plus Addons for Elementor Pro를 사용할 때 Tabs 위젯 내의 콘텐츠가 번역되지 않습니다.

임시 해결 방법

진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.


  • 테마의 functions.php 파일을 여세요.
    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']);
    }
            

알려진 모든 문제 →