WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using the Advanced Custom Fields plugin for Wordpress,

Suppose I have a radio button field with possible choices:

o Apples o Bananas o Cranberries

How can I return each one of these options regardless of which one is selected?

Thanks everyone

share|improve this question
up vote 3 down vote accepted

Check out this page in order to discover your field key for your radio button: http://www.advancedcustomfields.com/docs/functions/get_field_object/

Next, insert this code where you are grabbing your field values:

 $key = 'your_fieldkey_here';
 $field = get_field_object($key); 
 if ($field) {
       foreach ($field['choices'] as $key => $value) {
        echo ('KEY : ' . $key);
        echo ('<br />');
        echo ('VALUE : ' . $value);
        echo ('<br />');

This code will return your set of keys and values.

This only issue with this method is that it will not work if your radio button field is inside of a repeater field.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.