Support

Account

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'];
          }
        }
      }
    }