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
}
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.