Skip to content

Instantly share code, notes, and snippets.

@tjhole
Created September 7, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjhole/0085e031f98b3506004d to your computer and use it in GitHub Desktop.
Save tjhole/0085e031f98b3506004d to your computer and use it in GitHub Desktop.
ACF : Lookup Radio Checkbox Field Labels
<?php
$field_key = get_field('key_field');
$field = get_field_object($field_key);
if( $field ):
echo '<ul id="filter" class="' . $field['key'] . '">';
foreach( $field['choices'] as $k => $v ) {
echo '<li class="filter" data-filter="'. $k .'">'. $v .'</li>';
}
echo '</ul>';
endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment