[wp-trac] [WordPress Trac] #13817: Reusing the Media Upload kit in a plugin
WordPress Trac
wp-trac at lists.automattic.com
Thu Jun 10 12:21:48 UTC 2010
#13817: Reusing the Media Upload kit in a plugin
-----------------------------+----------------------------------------------
Reporter: simonwheatley | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 3.0
Severity: normal | Keywords: dev-feedback
-----------------------------+----------------------------------------------
I'm keen to reuse the Media Upload overlay (i.e. the thickboxed iframe
from the edit post/page screens) when I need to upload files for a plugin.
It seems crazy to be reimplementing file upload and image resizing code
when it's built into WordPress core. However the hooks aren't there
currently.
The attached proof of concept plugin "rmu-poc.php" shows that it is
possible to write a plugin which pops up the upload overlay (install it
and go to the edit category screen), but a number of issues prevent it
being useful:
The form is setup to be called in the context of the edit post/page
screen, for example the JS callback expects to find a function
''send_to_editor'' which will accept it's HTML.
It would be handy to insert some additional post fields to be sent when
the SWF Uploader uploads files, so the plugin can detect that it should be
doing something with that upload.
The ''get_media_item'' function needs a way to customise the button label.
Currently the proof of concept does a very ugly hack on a translation
filter.
Before I get over excited, is anyone up for these changes? If I started
cutting some patches, would they be considered?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13817>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list