- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual CMS 4.5.14
- Đã giải quyết trong
- WPML 4.6.4
- Plugin/giao diện liên quan
- Elementor
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Nếu bạn đang sử dụng tính năng mẫu vòng lặp Elementor, các nút không được dịch trên giao diện người dùng ngay cả khi chúng có sẵn để dịch trong Trình biên tập dịch thuật nâng cao.
Giải pháp tạm thời
Vui lòng đảm bảo tạo bản sao lưu đầy đủ cho trang web của bạn trước khi tiếp tục.
- Mở tệp /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php.
- Tìm dòng 108.
- Thay thế phương thức
WPML_Elementor_Translate_IDs::translate_global_widget_ids():public function translate_global_widget_ids( $data_array, $post_id ) { foreach ( $data_array as &$data ) { if ( isset( $data['elType'] ) && 'widget' === $data['elType'] ) { if ( 'global' === $data['widgetType'] ) { $data['templateID'] = $this->translate_id( $data['templateID'] ); } elseif ( 'template' === $data['widgetType'] ) { $data['settings']['template_id'] = $this->translate_id( $data['settings']['template_id'] ); } } $data['elements'] = $this->translate_global_widget_ids( $data['elements'], $post_id ); } return $data_array; }Bằng:
public function translate_global_widget_ids( $data_array, $post_id ) { foreach ( $data_array as &$data ) { if ( isset( $data['elType'] ) && 'widget' === $data['elType'] ) { if ( 'global' === $data['widgetType'] ) { $data['templateID'] = $this->translate_id( $data['templateID'] ); } elseif ( 'template' === $data['widgetType'] || 'loop-grid' === $data['widgetType'] || 'loop-carousel' === $data['widgetType']) { $data['settings']['template_id'] = $this->translate_id( $data['settings']['template_id'] ); } } $data['elements'] = $this->translate_global_widget_ids( $data['elements'], $post_id ); } return $data_array; } - Dịch mẫu vòng lặp Elementor trong WPML → Quản lý dịch thuật.