Home › Forums › Front-end Issues › Issue of adding ACF to an existing form › Reply To: Issue of adding ACF to an existing form
If there is no post ID when ACF is saving the information then it could be saved anywhere. I’m sure ACF is saving the information somewhere, but without it being able to get the post ID then it cannot save. ACF runs on the WP hook “save_post”. This hook passes the post ID and if there is no post ID then ACF attempts to figure out what it is by looking at WP global values. If you’re plugin is somehow bypassing the normal method of adding a post when a form is submitted then ACF is probably using the post ID of whatever page the form appears on instead of the post ID of the post created by that plugin.
If the above is the case what I would do is look into the plugin and figure out is there is a hook in that plugin that runs after it has created the post that hopefully passes the post ID to actions or filters and I would add an action or filter to for that hook and in my filter I would run the acf filter by doing
do_action( 'acf/save_post', $post_id );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.