I’d like to create a post with some ACF with php code (because I need to inject some contents from another source).
I saw the tuto using-acf_form-to-create-a-new-post and acfsave_post but I can’t figure how to create the custom fields.
What’s the trick?
Are you creating the custom fields from scratch and adding them to a field group, ie. outside of the post itself? If so, set up a sample custom field group and choose PHP export – you’ll get a PHP file that you can include in your script that you can tweak to add new custom fields to the field group.