Its a wordpress+jQuery question. Can’t post it on stackoverflow because i believe it involves wordpress knowledge too.
What I am trying to achieve:
I am attaching the wordpress async media uploader on “add post” page metabox so user can upload lots of images simply drag and drop them into the uploader and don’t have to insert them once at a time (see the image).
I am saving the attachment ids on a post meta so user can attach one image to more then one post.
Question: When the uploader send the upload request to the async-upload.php
it sends back an html response which contains the whole form for adding title, caption, description for the attachment. Very first of the response comes with this:
<input type="hidden" id='type-of-106' value="image" />
You can see a full response here.
My question is how to I get the attachment id from that html response? I am guessing I have to listen for any ajax response that comes from the async-upload.php
then look through the response.