This is what I want to do:
- In the media uploader, add a link “Use this attachment ID as custom field”.
- Add the attachment ID in a custom fields meta box.
I’ve searched for hours for a plugin that does this but found nothing. Code examples, plugins, hints. Anything might be helpful.
I found it:
http://www.acousticwebdesign.net/web-design/creating-custom-meta-boxes-in-wordpress/
When you upload attachments to a post/page they become child elements of that post/page.
What you can do is provide a drop down in your custom field to list all uploaded files to the uploader for the current post/page. This is the code I used to show a list of files so the user could select which one was a floor plan image: