I want to use acf_form only for the form itself (to hook into validations, etc instead of having to code a custom form. Essentially, I want to use fields to complete other actions via acf/save_post (specifically running actions for an External, Third Party API like Salesforce based on the acf_form fields)
I am able to execute the third-party API functions with the above, however, the post where I’m embedding the above acf_form creates post_meta on that post. What I would like to do is prevent this from happening (I am currently just resetting/deleting all of the field values upon completion, but would like to know if there’s a better way.
I’m not sure the above works anymore. I keep running into empty posts created and can only be deleted from the database.
The ACF method pre_save_post expects something numeric OR ‘new_post’ so what I do is pass neither of those things but instead 'post_id' => 'no_new_post' which seems to work. I also use acf/save_post hook at a priority less than 10 ( in my case 4 ).
I also get errors when unsetting $_POST['acf'] so I’ve been opting to use $_POST['acf'] = array();
Undefined index: acf in advanced-custom-fields-pro\includes\acf-form-functions.php on line 157
Viewing 4 posts - 1 through 4 (of 4 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