Using Image insert control in code

I am adding additional pages to wordpress backend and I would like to use the built-in image uploader and browser. I couldn’t find any examples on how to add it to my form.

Assuming that I have a text input or something similiar – what do I have to do to allow users pick a previously uploaded image so that the image link would show up in the textfield?

Read More

edit:

I’ve created an iframe that’s loading media-uploader.php but now I have no idea how to get the picked image to go to my textfield.

Related posts

Leave a Reply

3 comments

  1. I needed to do something similar (inserting external images into posts from a specific source) and I couldn’t find any appropriate hooks or functions to use, so I ended up copying the relevant code from wp-admin/includes/media.php and wp-admin/media-upload.php into my plugin in order to use the functionality.

  2. I am a little confused. Do you mean that you want the end user to be able to use the image picker from the back end, and have access to all the pictures from other sections?

    If so, I’m pretty sure it already does that, by default.