Home › Forums › Front-end Issues › Update parent and child repeater programmatically › Reply To: Update parent and child repeater programmatically
It has to be in the way that you’re constructing the nested array. Going to be honest, I’m not exactly sure what the problem is. In your first code if you can output the array that you’ve constructed that might tell you where it’s going wrong
echo '<pre>'; print_r($data); echo '</pre>';
update_field( $field_key, $data, $post_id );
I can tell you that in your second code you have a similar problem to the first code you poasted. You are trying to add a sub row to a repeater that does not exist yet. add_sub_row()
is called before the update_field()
call that creates the repeater that you want to add the row to.
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.