Когда создали пост, вызываете функцию
update_field("field_5693402ab8561", $attach_id, $post_id );
$selector (string) - the field name or key (required)
$value (mixed) - the value to save (required)
$post_id (mixed) - Specific post ID where your value was entered. Defaults to current post ID