Support

Account

Forum Replies Created

  • I have found a solution:

    We can use update_field to add new rows to a repeater inside a group.

    1. Get all values of the fields inside that group
    2. Manipulate the resulting array adding new values in the repeater’s array
    3. Update the group field.

    It works even if the repeater never had any rows.

    $pachet_8 = get_field("pachet_8", $post_id);
    		
    $pachet_8['rata_3']['plati'][] = array(
    													"suma" => 1001,
    													"data_platii" => "10.10.2018"															
    													);
    		
    update_field("pachet_8", $pachet_8, $post_id);
  • I have the same problem. I have a repeater inside a group. I can’t add new rows to the repeater, programatically. I have tried using add_row with field names or keys. add_row returns integers but in the backend I can’t see any values.

    I have tested also with a repeater outside the group. On that it works using add_row.

    Thanks for any help!

    add_row(
    	"field_5b606d31f4bb9",
    	array(
    		"field_5b607763dc795" => 100,
    		"field_5b606d3bf4bba" => "10.10.2018"													
    		),
    	$post->ID
    );
    
Viewing 2 posts - 1 through 2 (of 2 total)