Home › Forums › ACF PRO › Frontend Form – acf_form + add_row with $_POST › Reply To: Frontend Form – acf_form + add_row with $_POST
Hi,
Solved my issue with this bit of code.
foreach($_POST['row'] as $rows)
{
$row = array(
'field_59131578f9daf' => $rows['category'],
'field_59104ba3d8b5a' => $rows['product'],
);
add_row('field_59104b8fd8b59', $row, $post_id);
}
<input type="hidden" name="row[<?php echo $i; ?>][category]" value="<?php echo $term_id; ?>" />
<input type="radio" name="row[<?php echo $i; ?>][product]" value="<?php echo get_the_ID(); ?>" <?php if ( get_the_ID() == $product_id ) echo 'checked="checked"'; ?> ><?php the_title(); ?>
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.