I’m working on a simple document plugin for a client, using the new Custom Post Types in WordPress 3.
We’d like to have just the title and an upload field. So, I’m setting:
register_post_type('post_type_name', array('supports' => array('title'), ...)
to only have the title show up. Now, what’s the best way to add an upload field?
I started by adding a meta box using
add_meta_box, and having a simple
input type="file"there. But the post form does not have the
enctypeset. I found a bug report, but the developers mention that it is better to handle the uploads asynchronously. Are there any resources available that discuss this?
- The topic ‘Best practices for adding attachments to custom post types’ is closed to new replies.