Support

Account

Home Forums Front-end Issues ACF Checkbox Choices Reply To: ACF Checkbox Choices

  • @julianmarcorpsa-com Have you tried dropping the underscore from the meta_key value…so just = 'mychoices'. I ask because when I use a plugin called Search & Filter Pro, I have to select the meta key to pick which which field I want to filter by. In the list of available fields, each field shows up twice, one with a preceding underscore and one without. I have to use the one without in order for it to work correctly.

    But if that’s not the case, you should be able to do something like:

    
    <?php
    $values = get_field('mychoices');
    $field = get_field_object('mychoices');
    $choices = $field['choices'];
    ?>
    
    <ul>
    	<?php foreach( $choices as $choice => $label ) : ?>
    	<li>Value: <?php echo $choice; ?>, Label: <?php echo $label; ?></li>
    	<?php endforeach; ?>
    </ul>
    

    Let me know if that doesn’t work for you. I didn’t get a chance to test out, but I just did something similar the other day.