Skip to content

Instantly share code, notes, and snippets.

@samuelcotterall
Created May 17, 2015 17:45
Show Gist options
  • Save samuelcotterall/6b88ac76c2449535b925 to your computer and use it in GitHub Desktop.
Save samuelcotterall/6b88ac76c2449535b925 to your computer and use it in GitHub Desktop.
acf issue
function cl_acf_set_language() {
return acf_get_setting('default_language');
}
function get_global_option($name) {
echo acf_get_setting('current_language'); // it
add_filter('acf/settings/current_language', 'cl_acf_set_language');
echo acf_get_setting('current_language'); // en
$option = get_field($name);
remove_filter('acf/settings/current_language', 'cl_acf_set_language');
echo acf_get_setting('current_language'); // it
return $option;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment