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 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.