Created
May 17, 2015 17:45
-
-
Save samuelcotterall/6b88ac76c2449535b925 to your computer and use it in GitHub Desktop.
acf issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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