[wp-hackers] Custom Post Types and Media Attachments

John Blackbourn johnbillion+wp at gmail.com
Tue Dec 14 03:59:54 UTC 2010

Okay I've just written some code which gets around this problem,
albeit in a bit of a bizarre way.


Basically the function plugin_foo_insert_button_hack() is called when
you upload a file, and at the top of the media browser. It checks the
current post's post type for support for 'my_plugin_feature' and adds
support for 'editor' in order to force the 'Insert Into Post' button
to show up. It's wholly inelegant but it works and that's all I need
at this moment in time, so it'll have to do.

You'll probably need to tweak this to apply to your own
plugin/situation, but hopefully this will be of help to someone else.

I'll open a bug report in due course but I think the whole media
management system is due an overhaul shortly (3.2?) so it might end up
being a moot issue.

More information about the wp-hackers mailing list