Home › Forums › Add-ons › Repeater Field › Update/ Create new repeater block with foreach loop › Reply To: Update/ Create new repeater block with foreach loop
if ($orig_cart_items) {
$field_key = "field_59aff2511ca92";
$value = array();
foreach ($orig_cart_items as $item) {
$value[] = array(
'festival_id' => $item['show_festival_id'],
'edition_id" => $item['show_edition_id'],
'movie_id' => $item['show_movie_id']
);
} // end foreach
update_field($field_key, $value, $post_id);
} // end if
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.