Support

Account

Home Forums General Issues Discrepancy between live page and page preview (using WPML) Reply To: Discrepancy between live page and page preview (using WPML)

  • Hi @plinth

    Please keep in mind that ACF lets you translate the options page so you can have different setups for each language. If you want to have the same value on all of your languages, you can use the acf/save_post hook to update the options in the other languages. It should be something like this:

    function my_acf_save_options( $post_id ) {
        
        if( $post_id == 'options' ){
            $value = get_field('field_name', $post_id);
            update_field('field_name', $value, 'options_fr');
        }
        
    }
    
    // run after ACF saves the $_POST['acf'] data
    add_action('acf/save_post', 'my_acf_save_options', 20);

    With that code, you can update the options on the main language options page and it should be copied to the other languages (in this case, France).

    I hope this helps 🙂