Home › Forums › Front-end Issues › Reassign random Post ID with actual Post ID for new post › Reply To: Reassign random Post ID with actual Post ID for new post
Lots of quesitons above, and I’m a bit confused about what exactly you need help with, but lets first start with the form.
There is a code example here which shows how to use the pre_save_post filter to modify the post_id of a new post:
I have a feeling, your issue is not actually with the post, but with the uploaded images, right?
I would simply get the image data via get_field, then use the image ID to update the actual attachment row in the database.
WP has a function called update_post. And if you send through an array containing the ID and also the post_parent value you want, you can modify this media attachment.
If this does not answer you question, could you perhaps simplify you question?
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!
© 2023 Advanced Custom Fields.