Skip navigation

Open

Topic Tags: Compatibility

Overview of the issue

Blank spaces implemented using non-breaking spaces in BeTheme’s BeBuilder, are not being copied to the translated versions of the pages.

Workaround

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

  • Open the …/wp-content/themes/betheme/functions/theme-functions.php file.
  • Loof for line 3784.
  • Replace this code:
    /*
     * 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 );
    
  • With:
    /*
     * 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 );
    

Написать ответ

Пожалуйста, оставайтесь в теме и будьте уважительны к другим. Если Вам нужна помощь по вопросам, не относящимся к этому сообщению, воспользуйтесь нашим Форумом поддержки, чтобы начать чат или отправить тикет.

Вы можете использовать эти метки:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>