Soubhagya Kumar Barik
Soubhagya Kumar Barik

Reputation: 2595

Add a new row with data to an existing repeater in ACF

i am trying to add a new row with data to an existing repeater in acf.There is no error but this code unable to insert data in database. this is what i have tried

$row = array(
    'vacation_from_date'    => '20/10/2017',
    'vacation_to_date'  => '25/10/2017',
);
$field = get_field_object('vacations','user_' . $user_id);
add_row($field['key'], $row);

here is my screenshot for wp-adminenter image description here

Upvotes: 2

Views: 1589

Answers (1)

Paul
Paul

Reputation: 1422

Should it not be

add_row('vacations', $row, $post_id);

Or is there a reason you are using

get_field_object()

Upvotes: 3

Related Questions