Home › Forums › Add-ons › Repeater Field › problems saving file type repeater field › Reply To: problems saving file type repeater field
I’m glad that worked for you.
Regarding your questions:
1. ACF saves two entries in the database when you save a custom field, the value and the reference. This mostly happens when you save a post from the backend. The value looks like this:
field_name : field value
While the reference looks like this:
_field_name : field_1234567890abc
The reference is important for ACF to know which field you want to save/update exactly. That’s because you can have multiple fields with the same name on a single page, but you can’t have multiple fields with the same field key.
When you create a post programmatically, the reference is not created automatically. So, you need to use the field key instead of the field name. That way ACF know which field you want to save/update.
2. Yes, the
add_row() should be working. I think the issue is the same with the first answer. If you want, you can try to use that function again and use the field key instead of the field name for the parent selector.
I showed you the
update_field() function because it’s the most basic one and it should show the saving process more clearly.
I hope this helps 🙂
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.