[wp-hackers] Utilize Media Library for image selection for plugin

Seamus Leahy seamus at moronicbajebus.com
Tue Sep 2 22:05:43 GMT 2008


How can I utilize the media library for image selection in my plugin?

Overview:

I am creating a plugin which needs to have a field on its own admin panel
which selects an image. Instead of creating a new image uploader and
manager, I would like to utilize the already existing Media Library in
Wordpress.

My Progress:

I have managed to create the link which brings up the thickbox + iframe with
the media library. It seems to be focused on inserting the image into the
editor because the passed back Javascript tells the editor to insert the
HTML needed for the image. I am hoping there is an easy way to alter the
message back and turn it into a object which I can use on the admin panel.
If that doesn't work, can I easily use parts of the functionality such as
the upload form?

Any thoughts or suggestions to save myself from wasting countless hours?


Seamus.


More information about the wp-hackers mailing list