WPML

Overview of the Issue

Translating Avia Layout Builder pages (included in Enfold theme) isn’t working correctly when we use the advanced layout editor.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

Adding this snippet to functions.php in your theme will make sure that the internal data is synchronized correctly when adding translations with the translation editor.

add_action( 'wpml_translation_job_saved', '_sync_avia_layout_builder', 10, 3 );
function _sync_avia_layout_builder( $new_post_id, $fields, $job ) {
    if ( isset( $fields['body']['data'] ) ) {
        if ( 'active' === get_post_meta( $new_post_id, '_aviaLayoutBuilder_active', true ) ) {
            update_post_meta(
                $new_post_id,
                '_aviaLayoutBuilderCleanData',
                $fields['body']['data']
            );
        }
    }
}

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.