WPML
ステータス
解決済み
関連するプラグイン/テーマ
Elementor

問題の概要

Elementorでコンテンツを含むショートコードウィジェットを使用しており、WPMLの翻訳エディタを使用してページを翻訳する場合、そのショートコードのコンテンツは翻訳できません。

回避策

現在、この問題の修正に取り組んでいます。それまでの間、テーマのfunctions.phpファイルに以下のコードスニペットを追加することで修正できます。

add_action('init', function (){
add_filter( 'wpml_elementor_widgets_to_translate', 'shortcode_widget_registration' );
});
 
/**
* Translate Shortcodes widget by elementor
* @param array $widgets
* @return array
*/
function shortcode_widget_registration($widgets) {
$widgets['shortcode'] = [
'conditions' => ['widgetType' => 'shortcode'],
'fields' => [
[
'field' => 'shortcode',
'type' => __('Enter your shortcode', 'sitepress'),
'editor_type' => 'AREA'
],
 
],
];
 
return $widgets;
}

追加が完了したら、元の言語でページを編集して翻訳を更新すると、ショートコードウィジェットのコンテンツが翻訳可能になります。

すべての既知の問題 →