WordPress media upload: insert uploaded file to post immediately after upload

I need a minimal video upload mechanism in my plugin.

I use the built in media upload iframe:

Read More
tb_show("", "/wp-admin/media-upload.php?type=video&TB_iframe=true");

With fewer options:

add_filter('media_upload_tabs','dilute_media_upload_tabs');
function dilute_media_upload_tabs($tabs){
    return array(
        'type' => __('From Computer')
    );
}

I’d like to save the user from having to click on “Insert to post” button after every file upload, and instead, fire that event programmatically immediately after the file have been uploaded (or crunched or whatever…)

Any idea how to accomplish that?

Related posts

Leave a Reply