- Trạng thái
- Đã được giải quyết bởi nhà phát triển
- Đã giải quyết trong
- Ultimate Addons for Elementor Version 1.37.0.1
- Plugin/giao diện liên quan
- Ultimate Addons for Elementor
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Khi sử dụng widget Content Toggle từ plugin Ultimate Addons for Elementor, các template Elementor đã dịch không được hiển thị chính xác khi sử dụng Trình biên tập dịch thuật nâng cao (ATE). Thay vì hiển thị template đã dịch, widget này hiển thị nội dung bằng ngôn ngữ gốc trên trang đã dịch.
Giải pháp tạm thời
Vui lòng đảm bảo tạo bản sao lưu toàn bộ trang web trước khi tiếp tục.
- Mở tệp functions.php trong giao diện của bạn.
- Thêm đoạn mã sau:
// WPML: Workaround for compsupp-7677 add_filter('elementor/frontend/before_render', 'wpml_compsupp7677_translate_content_toggle'); function wpml_compsupp7677_translate_content_toggle($element) { if (!class_exists('SitePress') || 'uael-content-toggle' !== $element->get_name()) { return; } $settings = $element->get_settings(); $keys_to_convert = [ 'section_content_', 'saved_pages_', 'section_saved_rows_' ]; $modified = false; foreach ($keys_to_convert as $key) { for ($i = 1; $i <= 2; $i++) { $setting_key = $key . $i; if (isset($settings[$setting_key]) && is_numeric($settings[$setting_key])) { $post_type = get_post_type($settings[$setting_key]); if ($post_type) { $settings[$setting_key] = apply_filters( 'wpml_object_id', $settings[$setting_key], $post_type, true ); $modified = true; } } } } if ($modified) { $element->set_settings($settings); } }