Home › Forums › Add-ons › Repeater Field › Repeater field saved in content › Reply To: Repeater field saved in content
Sorry about the typo in my code, glad you got it working.
Nested repeaters need nested loops
Let’s say that the key for the repeater is field_123 and the key for the nested repeater is key_321
if (!empty($_POST['acf']['key_123']) && is_array($_POST['acf']['key_123'])) {
foreach ($_POST['acf']['key_123'] as $row) {
// nested repeater
if (!empty($row['key_321']) && is_array($row['key_321'])) {
foreach ($row['key_321'] as $sub_row) {
$something = $sub_row['some-field-key'];
}
}
}
}
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.