Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

acf get all checkbox options

<?php  
  // If your ACF field return option is set to value then:
  $data= get_field_object('types'); // where types is the acf field name 
  $types= $data["choices"]; // ACF use the parameter choices as the options array data
?>
<select name="my-types">
  <option value="">Select...</option>
  <?php foreach($types as $type){ ?>
     <option><?php echo $type; ?></option>
  <?php } ?> 
 
PREVIOUS NEXT
Tagged: #acf #checkbox #options
ADD COMMENT
Topic
Name
4+4 =