Support

Account

Home Forums Add-ons Repeater Field Add repeater row data via PHP – Issue when there is no data Reply To: Add repeater row data via PHP – Issue when there is no data

  • Ok finally figured this out (documentation isn’t very clear on this one)

    If you have zero rows to start with you need to do this:

    $field_key = “field_5657dffe586cc”;
    $value = get_field($field_key, ‘user_24’);
    $value[] = array(“career_enjoyment_id” => “Foo”, “career_enjoyment_file” => “Bar”);
    update_field( $field_key, $value, ‘user_24’ );

    The $field_key is located in the wordpress posts table assigned to the main repeater. Use the ID from post_name.