Support

Account

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