탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

If you are using Avada theme, you will experience that the notification values set within Avada Forms are not available for translation in the Advanced Translation Editor.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open your theme’s functions.php file.
  • Add the following code:
    /*
    WPML Updated workaround for AVADA
    REF: compsupp-6224
    */
    add_filter( 'wpml_decode_custom_field', 'wpmld_compsupp6224_decode', 10, 2 );
    function wpmld_compsupp6224_decode( $custom_field_val, $custom_field_name ) {
        if ( $custom_field_name === '_fusion' ) {
    		$custom_field_val['notifications'] = json_decode($custom_field_val['notifications']);
    		foreach($custom_field_val['notifications'] as $key => $value) {
    			$custom_field_val['notifications'][$key] = (array)$value;
    		}
    		
    	}
    	return $custom_field_val;
    }
    
    add_filter( 'wpml_encode_custom_field', 'wpmld_compsupp6224_encode', 10, 2 );
    function wpmld_compsupp6224_encode( $custom_field_val, $custom_field_name ) {
    	if ( $custom_field_name === '_fusion' ) {
    		$custom_field_val['notifications'] = json_encode($custom_field_val['notifications']);
    	}
    	return $custom_field_val;
    }
    
  • Go to WPML > Settings > Custom XML Configuration page.
  • Add the following XML:
    <wpml-config>
      <custom-fields-texts>
            <key name="_fusion">
                <key name="page_title_custom_text" />
                <key name="page_title_custom_subheader" />
                <key name="video" />
                <key name="link_icon_url" />
                <key name="video_url" />
                <key name="project_url" />
                <key name="project_url_text" />
                <key name="copy_url" />
                <key name="copy_url_text" />
                <key name="youtube_id" />
                <key name="heading" />
                <key name="caption" />
                <key name="button_1" />
                <key name="button_2" />
                <key name="vimeo_id" />
                <key name="notifications">
                    <key name="*">
                        <key name="label"/>
                        <key name="email_subject"/>
                        <key name="email_from"/>
                        <key name="email_from_id"/>
                        <key name="email_reply_to"/>
                        <key name="email_message"/>
                        <key name="email_from"/>
                        <key name="email_from_id"/>
                    </key>
                </key>
            </key>
        </custom-fields-texts>
    </wpml-config>
    
  • Add a small notification to your form and translate it agin.

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>