WPML
ステータス
未解決
関連するプラグイン/テーマ
BeTheme
トピックタグ
Compatibility

問題の概要

BeThemeのBeBuilderでノーブレークスペースを使用して実装された空白は、ページの翻訳バージョンにコピーされません。

回避策

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


  • …/wp-content/themes/betheme/functions/theme-functions.phpファイルを開きます。

  • 3784行目を探します。

  • 以下のコードを:
    /*
     * WPML | Workaround for compsupp-5901
     */
     
    function mfn_wpml_encode_custom_field( $custom_field_val, $custom_field_name ) {
      if ( $custom_field_name === 'mfn-page-items' ) {
          $custom_field_val = maybe_unserialize( base64_decode($custom_field_val) );
        }
        return $custom_field_val;
    }
    add_filter( 'wpml_encode_custom_field', 'mfn_wpml_encode_custom_field', 10, 2 );
     
    function mfn_wpml_decode_custom_field( $custom_field_val, $custom_field_name ) {
        if ( $custom_field_name === 'mfn-page-items' ) {
            $custom_field_val = base64_encode( serialize($custom_field_val) );
        }
        return $custom_field_val;
    }
    add_filter( 'wpml_decode_custom_field', 'mfn_wpml_decode_custom_field', 10, 2 );

  • 次のコードに置き換えます:
    /*
     * WPML | Workaround for compsupp-12016
     */
    
    function mfn_wpml_encode_custom_field( $custom_field_val, $custom_field_name ) {
      if ( $custom_field_name === 'mfn-page-items' ) {
    	$custom_field_val = mb_convert_encoding($custom_field_val, 'UTF-8', 'auto');
    	$custom_field_val = base64_encode( serialize($custom_field_val) );
      }
      return $custom_field_val;
    }
    add_filter( 'wpml_encode_custom_field', 'mfn_wpml_encode_custom_field', 10, 2 );
    
    function mfn_wpml_decode_custom_field( $custom_field_val, $custom_field_name ) {
    	if ( $custom_field_name === 'mfn-page-items' && is_string($custom_field_val) ) {
    		$custom_field_val = mb_convert_encoding($custom_field_val, 'UTF-8', 'auto');
    		$custom_field_val = maybe_unserialize( base64_decode($custom_field_val) );
    	}
    	return $custom_field_val;
    }
    add_filter( 'wpml_decode_custom_field', 'mfn_wpml_decode_custom_field', 10, 2 );

すべての既知の問題 →