Home › Forums › General Issues › How to display default language Options field, when no WPML translation exists › Reply To: How to display default language Options field, when no WPML translation exists
Hi @infoamitywebsolutions-co-uk
Please keep in mind that the_sub_field()
will echo the value automatically, so you don’t have to use echo
anymore.
Also, the best thing to do in this kind of situation would be creating a script that will copy the values from the master site to the translated page. You can list the fields name you use for the options page, loop through it and update the translated site like this:
$options_field_names = array('field_name_1','field_name_2', 'field_name_3');
foreach( $options_field_names as $options_field_name ){
$master_value = get_field($options_field_name, 'options', false);
update_field($options_field_name, $master_value, 'options_de_');
}
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!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.