Support

Account

Home Forums ACF PRO Add value as classes checkbox Reply To: Add value as classes checkbox

  • It’s not exactly what I want. But I find out the solution :

    <?php 	$field = get_field_object('equipement');
    	$equipements = $field['choices'];
    	$equipements_selected = $field['value'];							
    	if (sizeof($equipements_selected)>0) {
    	?>
    	<ul>
    	<?php foreach($equipements_selected as $equipClass) {
    		$equipLabel = $equipements[$equipClass];
    	?>
    	<li class="<?php echo $equipClass; ?>"><?php echo $equipLabel; ?></li>
    	<?php	} // foreach ?>
    	</ul>
    	<?php 	} // if sizeof ?>

    Thank you for your answer.