Skip Navigation

Resolved by author

Overview of the issue

When you try to translate content built with BeTheme’s Muffin Builder, the translated content is not displayed in front-end, or the content is encoded as displayed on the screenshot below:

Content created using Muffin Builder is encoded

Workaround

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

  1. Update to the last version of Betheme
  2. Go to Betheme > Theme Options > Global > Advanced > Muffin Builder data storage and select the Serialized | Readable format, required by some plugins option
  3. Open the wp-content/themes/betheme/functions/theme-functions.php file and search for the snippet below:
    /*
     * 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 );
    
  4. Replace it with the snippet below:
    
    /*
     * 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 = 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 = maybe_unserialize( base64_decode($custom_field_val) );
    	}
    	return $custom_field_val;
    }
    add_filter( 'wpml_decode_custom_field', 'mfn_wpml_decode_custom_field', 10, 2 );
    
  5. If you have already started to translate your pages, edit the original page and save.
  6. Update the translation and the content should be available now.

Next steps to resolve this issue

We’ve reached out to the BeTheme and Muffin Builder authors, who will implement a fix ASAP. There is no need for you to do anything right now!

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>