Support

Account

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 );