WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
Please accept your own answer by clicking on the checkmark next to it. :-) – Pieter Goosen Dec 6 '14 at 9:27

Your Answer


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.