Home › Forums › Front-end Issues › Get option labels without post/user ID › Reply To: Get option labels without post/user ID
get_field_object requires the field key if you are not referencing a saved value. The field key looks something like: field_53beaa2f69615
In the Edit Field Group screen:
Screen Options (window shade) > Show Field Key: Yes
One you have it:
$field = get_field_object($field_key);
echo $field['choices']['fr'];
foreach( $field['choices'] as $name => $label ) { ... }
For more: http://www.advancedcustomfields.com/resources/get_field_object/
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.