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
Hi @acfbigfan
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:
http://www.advancedcustomfields.com/resources/tutorials/using-acf_form-to-create-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?
Thanks
E
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.