Home › Forums › Add-ons › Flexible Content Field › Add Flexible Content and fields to post › Reply To: Add Flexible Content and fields to post
Documentation should be here:
https://www.advancedcustomfields.com/resources/add_sub_row/
So, you need to know your flex-content fields’ field name too.
For example, if your field_name is ‘page_blocks’, you’d do something like:
foreach ($config as $index => $field) {
foreach ($field['subfields'] as $key => $value) {
add_sub_row(array('page_blocks', $index, $key), $value);
}
}
p.s i haven’t tested yet.
Cheers
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.