Support

Account

Home Forums ACF PRO Repeaterfield in ACF User Registration Form Reply To: Repeaterfield in ACF User Registration Form

  • What are the fields in the above code that are from the repeater?

    Past that, your code can run into problems. You should be using update_field() https://www.advancedcustomfields.com/resources/update_field/ and you should be using the field keys and not the field names as explained on this page. How to construct the correct $post_id value for a user is explained on this page https://www.advancedcustomfields.com/resources/get_field/

    With that said, inserting a repeater requires constructing an array of values

    
    // array holding all of the rows of the repeater
    $values = array(
      // a nested array for each row
      array(
        // field key => value pairs for this row
        'field_123456' => 'value of field',
      ),
    );
    // update field using field key
    update_field('field_xyz543', $values, 'user_'.$user_id');