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 create a form for user to submit content from the frontend. The only problem is I don't know how to handler the image upload.

So, I want to know how to use the WP media uploader in the frontend. The media uploader should be appeared like in the 'wp-admin/media-new.php'. I don't want the pop up version of the uploader, as it seen in post/page page. Because it has other feature that I don't want user to use, such as 'Media Library', 'Create gallery', 'Set Featured Image' etc.

Is there any tutorial or documentation on how to do it?

Thanks

share|improve this question
add comment

3 Answers 3

Add this code to your theme's functions.php file:

function add_media_upload_scripts() {
    if ( is_admin() ) {
         return;
       }
    wp_enqueue_media();
}
add_action('wp_enqueue_scripts', 'add_media_upload_scripts');

This will cause the the media upload files to load on your front end pages. If you would like to load them only on one specific page where they will be needed, you can wrap wp_enqueue_media() in an if_page() statement to check to see if the page being displayed is the specific page you need.

After that, you can follow the instructions in this tutorial: http://codestag.com/how-to-use-wordpress-3-5-media-uploader-in-theme-options/

share|improve this answer
    
Okay, I will try this and get back to you if it is working. –  ron_dev Oct 2 '13 at 15:30
add comment

the Ajax calls for /wp-admin/media-upload.php so there is good position to start.

it calls the action: "media_upload_$type", for exemple media_upload_image from /wp-admin/includes/media.php#L2512

that is connected to the function wp_media_upload_handler()

You can dig deeper from there. ( I need som sleep now :-) )

share|improve this answer
    
Your suggestion seem need a lot of time for me to figure out how to apply it. However, I found out that wp is come with plupload plugin. So I will dig into this first. Your Thanks for the suggestion. –  ron_dev Aug 14 '13 at 10:57
add comment

Here is the results from a Google search I did and here is a plugin that will allow you to upload from the frontend of your site Frontend Uploader

That should get you started in a good direction as far as tutorials that be available.

Good luck

share|improve this answer
    
No, I don't want the third party plugin. Anyway thanks for your suggestion. –  ron_dev Aug 14 '13 at 10:51
add comment

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.