Created
August 7, 2017 14:00
-
-
Save samy/84745fc3b0a7a4ffe89b5546fcc30a72 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 getACFLabel($slug) | |
{ | |
$translated_post_id = icl_object_id($post->ID,'post',false,ICL_LANGUAGE_CODE); | |
$field = get_field_object($slug, $translated_post_id); | |
$value = get_field($slug, $translated_post_id); | |
return $field['choices'][$value]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment