I have a custom field group, and I am using get_field_object.
I need to build a list with items that are a true/false type field. This is what i have so far.
$type['true_false'] does not seem to be returning the value in the field_object array for type.
I have had a look at the acf documentation and can only find reference to filtering by type in the filter section, which i'm not suree if it is appropriate here.
<ul class="has">
<?php
$fieldgroup_id = ('34');
// Get the entries of the field group
$custom_field_keys = get_post_custom_keys( $fieldgroup_id );
// Loop through the field group
foreach ( $custom_field_keys as $key => $fieldkey )
{
// Only return fields beginning with 'field_'
if ( stristr( $fieldkey, 'field_' ) )
{
$field = get_field_object( $fieldkey, $fieldgroup_id);
$label = $field['label']; $name = $field['name']; $type = $field['type'];
// ----------------------------------------------------------- Build List
if ( $type['true_false'] && get_field($name) ) {
echo " <li class=\"" . $name . "\">" . $label . "</li>\r\n";
}
}
}
?>
</ul>