I have a custom post type of listing and on the edit/publish screen I have 5 meta boxes that a user can add images to from the media library. Because the images are inserted from the post, they become attached to that post and I can then use a simple WordPress gallery on the front-end to display the images.
The problem I'm facing lies with a post submission form on the front end. I would like the user to upload 5 images from a form which generates a new post with those 5 images attached. Currently I am using a post "custom field" and linking each custom field up to the relevant wordpress custom field. This works great and if I then edit the post in the backend, I can see the 5 images in each of the 5 metaboxes. For some reason though, the images are not attached to the post and therefore don't appear in the gallery on the front end. Nor do they appear in the media library for that user.
I realise GF uploads the images into a gravity forms folder, and this is no problem, but how I can get the images attached to the post when they submit the form from the front end?
I thought to use a "post image" field instead while building the form but then I can't map it to each of the 5 meta boxes. Any ideas? Sorry for the long-winded post..