Support

Account

Home Forums Add-ons Repeater Field Repeater Sub Field Values In Array Reply To: Repeater Sub Field Values In Array

  • love arrays myself

    
    <?php 
      
      $fields = array(
        '8pp' => array(),
        '12pp' => array(),
        '16pp' => array(),
        '20pp' => array(),
        '24pp' => array(),
        '28pp' => array(),
        '32pp' => array()
      );
      if (have_rows('a5_digital_120gsm_uncoated')) {
        while(have_rows('a5_digital_120gsm_uncoated')) {
          the_row();
          foreach ($fields as $index => $values) {
            $fields[$index][] = get_sub_field($index);
          }
        } // end while have_rows
      } // end if have_rows
      foreach ($fields as $index => $values) {
        ?>
          <input type="hidden" id="a5120gsm<?php 
              echo $index; ?>" name="a5120gsm<?php 
              echo $index; ?>" value="<?php 
              echo implode('!',$values); ?>" />
        <?php 
      }
      
    ?>