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 );
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>