In the past when using thickbox to upload images, an image could be uploaded without having the post ID 'attached' to it by simply using the code below :

jQuery('.upload_slider_button').click(function() {
     tb_show('', 'media-upload.php?post_id=&type=image&TB_iframe=true&referer=matrix-settings');
     return false;

However, how can I achieve the same thing using the new Media Uploader which was introduced since WP3.5? I have spent the whole day searching in the internet but there isn't much resources available on this new media uploader. Most of it are focused on utilizing it in theme options / plugins.

Or perhaps there are other ways of uploading an image without having the post ID 'attached' to it and yet not using any plugins?

Thanks a lot for helping.

1 Answer 1


Well, I have finally figured it out. Using Mike's example here, I just need to put this code wp.media.model.settings.post.id = 0 at this place :


    wp.media.model.settings.post.id = 0;

    // If the media frame already exists, reopen it.
    if ( file_frame ) {

This will cause the image to be uploaded as 'Unattached'. Hope this helps someone facing this problem in the future.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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