Hi @hube2
Thanks for ur advise always!
I should have read the doc well…
Then I tried this code below
$my_post = […];
$post_id = wp_insert_post( $my_post );
$field = get_field_object(‘selector’, $post_id );
Update_field($field[‘key’], ‘value’, $post_id);
but $field is empty, so Update_field() does not work.
Do I have to use SQL instead of get_field_object()
to get field_key from field_name in case of a new post?