WPML
ステータス
開発者により解決済み
関連するプラグイン/テーマ
Uncode
トピックタグ
Compatibility

問題の概要

Within the UncodeテーマPosts (uncode_index)ショートコードを使用する際、2つの問題が確認されています:

  • 予期しないbase64エンコードコンテンツが高度な翻訳エディタに送信されます。
  • Postsショートコード内の「Read More」テキストを翻訳できません。

回避策

続行する前に、必ずサイトの完全なバックアップを作成してください。

2つの修正を適用する必要があります。

パートI

  • WPML > 設定 > カスタム XML 設定ページに移動します。
  • 以下のXMLを追加します。
    <wpml-config>
      <shortcodes>
        <shortcode>
          <tag>uncode_index</tag>
        </shortcode>
      </shortcodes>
    </wpml-config>

パートII

  • …/wp-content/themes/uncode/vc_templates/uncode_index.phpファイルを開きます。
  • 2558行目を探します。
  • 以下のコードを:
    if (isset($item_prop['read_more_text'])) {
    	$block_data['read_more_text'] = $item_prop['read_more_text'];
    }
  • 次のように置き換えます。
    if (isset($item_prop['read_more_text'])) {
    	$block_data['read_more_text'] = $item_prop['read_more_text'];
    
    	// WPML Workaround for compsupp-7136
    	if ( class_exists('Sitepress') ) {
    		$string = $block_data['read_more_text'];
    		$textdomain = 'WordPress';
    		$string_name = 'WPML Workaround : '.substr($string, 0, 20);
    
    		$wpml_default_lang = apply_filters('wpml_default_language', NULL );
    		$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
    
    		if ($wpml_default_lang == $wpml_current_lang ) {
    			do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
    		}	
    		// Apply the translation to the string
    		$block_data['read_more_text'] = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
    	}
    }

すべての既知の問題 →