Advanced Custom Fields select field : How to echo the label, not the value? [closed]

The get_field_object() function requires the field KEY not the field NAME. See docs: http://www.advancedcustomfields.com/resources/functions/get_field_object/

So it should looks something like this…

$field = get_field_object('field_53d27f5599979');
$value = get_field('field_myfield');
$label = $field['choices'][ $value ];

You can find the field key by clicking on “Screen Options” > “Show Field Key” and it should appear next to the field type. See attached animated gif-cast below.

Show Field Key

Leave a Comment