WPML
ステータス
開発者により解決済み
解決されたバージョン
Avada 7.11.4
関連するプラグイン/テーマ
Avada
トピックタグ
Compatibility

問題の概要

WordPress エディタを使用してAvadaLibrary Elementを手動で翻訳すると、要素のタイプ(例:「Container」)が翻訳先に引き継がれません。その結果、翻訳された要素は常にTemplateタイプとして識別されます。

他の言語へ複製する場合や、高度な翻訳エディタ(ATE)を使用して翻訳する場合、この問題は発生しません。

回避策

続行する前に、サイトの完全なバックアップを取得していることを確認してください。

オプション1


  • まず要素を複製します。

  • 次に、編集して個別に翻訳し、値を変更します。

オプション2


  • テーマのfunctions.phpファイルを開きます。

  • 次のコードを追加します。
    add_action( 'edit_form_top', 'callback__edit_form_top' );
    function callback__edit_form_top( $post ) {;
    	if ($post->post_type == "fusion_element") {
    		$trid = apply_filters( 'wpml_element_trid', NULL, $post->ID, 'post_'. $post->post_type );
    		$translations = apply_filters( 'wpml_get_element_translations', NULL, $trid, 'post_'. $post->post_type );
    		foreach ($translations as $translation) {
    			if ($translation->original == 1){
    				$original = $translation->element_id;
    			}
    		}
    		$originalterms = wp_get_post_terms( $original, 'element_category' );
    		$currenttranslationterms = wp_get_post_terms( $post->ID, 'element_category' );
    		if (empty($currenttranslationterms)) {
    			foreach ($originalterms as $term){
    				wp_set_object_terms( $post->ID, $term->term_id, $term->taxonomy );
    			}
    		}
    	}
    }
  • Avada > ライブラリに移動します。
  • 次に、まず要素を開いて保存します。
  • ページをリロードし、必要な要素を追加します。

すべての既知の問題 →