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:
Workaround
Please, be sure to make a full backup of your site before proceeding.
- Update to the last version of Betheme
- Go to Betheme > Theme Options > Global > Advanced > Muffin Builder data storage and select the Serialized | Readable format, required by some plugins option
- 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 );
- 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 );
- If you have already started to translate your pages, edit the original page and save.
- 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!