Home › Forums › Add-ons › Repeater Field › Repeater field saved in content › Reply To: Repeater field saved in content
a repeater field is a nested array in $_POST[‘acf’]
$_POST['acf'][$repeater_field_key][$ROW_INDEX][$subfield_key]
So you need to loop through the repeater field to get each row and then get the sub field
foreach ($acf[$repeater_field_key] as $row) {
$image_id = $row[$sub_field_key];
}
ACF stores attachment IDs for images, so if you want to insert it into the content you’ll need to use wp function to get the attachment information and build the image tag. https://developer.wordpress.org/reference/hooks/wp_get_attachment_image_src/
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.