Home › Forums › ACF PRO › Repeaterfield in ACF User Registration Form › Reply To: Repeaterfield in ACF User Registration Form
What are the fields in the above code that are from the repeater?
Past that, your code can run into problems. You should be using update_field()
https://www.advancedcustomfields.com/resources/update_field/ and you should be using the field keys and not the field names as explained on this page. How to construct the correct $post_id
value for a user is explained on this page https://www.advancedcustomfields.com/resources/get_field/
With that said, inserting a repeater requires constructing an array of values
// array holding all of the rows of the repeater
$values = array(
// a nested array for each row
array(
// field key => value pairs for this row
'field_123456' => 'value of field',
),
);
// update field using field key
update_field('field_xyz543', $values, 'user_'.$user_id');
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.