Home › Forums › Add-ons › Repeater Field › Add Row only works on published cpt's › Reply To: Add Row only works on published cpt's
Hi @snixx
I’ve just tested it on my installation and it was working on my drafted custom post type, both the add_row() and get_field() functions.
Did you add the new post programmatically? If you did, it’s possible that your post doesn’t have the repeater value in the database yet. Keep in mind that the add_row() function will only add a row to an existing repeater. I think you can use the update_field to add an empty value. This page should give you more idea about it: http://www.advancedcustomfields.com/resources/update_field/.
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 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.