I create a front-end form for the guest can submit a post. The form was created by Front End Plugin and It allows only some fields for the user to write. However, I create the ACF for saving the field value for the new post too and I set the default value. But it seems this ACF field is not set when the user submits the post. It will be saved/create only when I edit or update through Admin Edit Page.
Are there any resources for setting the default value through every new post?
Today I found the solution by using this code to my functions.php
and now the newly created post has the custom field with the default value.
ACF cannot set the default value of fields that are not submitted. This means that if they are not included in the form then ACF will not do anything with them.
The solution you found is similar to what I would suggest except that I would use an acf/save_post action