- ステータス
- 開発者により解決済み
- 関連するプラグイン/テーマ
- 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']); }