The value you would check for in your pre_save_post filter would be the same value you assign to “post_id” when setting up acf_form(). “new_post” is used as a default by ACF. If you use “new_post” in your acf_form() then ACF has a built in filter that runs on priority of 5 that will automatically create a new post of the post type “post”.
If you are creating a new “post” then in most cases there isn’t any reason to have a pre_save_post filter of your own.
What are you doing in your pre_save_post filter that requires special processing?
Yes, it is an old example from before that argument was added.
The only reason for using this filter is that there is something custom you want to do that ACF does not do but in most cases you can replace a pre_save_post filter with an acf/save_post action.
No, the documentation is not all 100% clear in this regard, but this is a user forum and the developers and maintainers of the documentation do not read these forums. If you think the documentation needs clarification then you need to contact the developers.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users