I’d like to be able to load a front-end form with data from an existing post, and then save the updated fields to a new post on submission.
I see that I can use acf/pre_save_post to create a new post to save to, but I’m not sure of the best way to only save updated values. Perhaps using acf/save_post and comparing the two posts?
Thanks for any suggestions?
Thanks for the mail.
By Hooking into the acf/save_post hook with a priority of higher than 10, you will have access to both the submitted values and the ones existing in the database.
Using this values, you can access evaluate and create new posts using the
Hope this helps.
To edit a certain post on the frontend, you would need to assign the post_id to the ‘post_id’ parameter of the acf_form(). You can then intercept the saved values within the pre_save_post by checking if the post id is the same as the one edited on the form.