Home › Forums › Add-ons › Repeater Field › ACF 5.0+ Dynamically Populating Repeater › Reply To: ACF 5.0+ Dynamically Populating Repeater
The solution is a bit messy and filled with a bunch of my classes functionality that won’t make much sense.
The gist is that:
What I did was check the field type against ‘repeater’ and returned my custom database value count. At the top of the hook I checked if the $field[‘parent’] was empty, if not I used get_field_object( $field['parent'], $post_id, false, false )
to get the parent field name that the subfield are prefixed with.
Once I returned the count to the repeater and stripped the parent name prefix off the subfields I was able to prepopulate the repeater with my custom table data. I have no idea if this will be helpful to anyone but at least it’s no longer a niche issue on the forums here.
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.