Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

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.

share|improve this question

3 Answers 3

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.

share|improve this answer
    
could you please post the plugin that you created and the admin metabox code you added to your custom post type? Thanks so much in advance –  NetConstructor.com Nov 5 '10 at 15:39
    
@NetConstructor.com It's not completed, but I will update here when it is finished. –  jjeaton Feb 10 '11 at 0:12
    
did you finish this by chance? –  NetConstructor.com Feb 12 '11 at 21:52

The Image Widget plugin uses the media uploader. You may want to look at its code source. It is very simple.

share|improve this answer
    
Thanks. I'll post here when I get to it and find it out. –  naugtur Oct 4 '10 at 10:47
    
You are welcome. –  sorich87 Oct 4 '10 at 10:57

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.

share|improve this answer
    
I want to know how to use the image picker in my code. I couldn't find that. –  naugtur Sep 13 '10 at 6:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.