WordPress.org

Forums

New Media Uploader (2 posts)

  1. jasonsweb
    Member
    Posted 2 years ago #

    Hi,

    I'm trying to integrate the new media uploader of 3.5 into my theme.
    In the versions older then 3.5 I used this jQuery code, which worked perfect:

    jQuery(document).ready(function() {
    
    	jQuery('.upload-button').click(function() {
    
    		window.send_to_editor = function(html) {
    
    			imgurl = jQuery('img', html).attr('src');
    			jQuery('.upload-image').val(imgurl);
    			tb_remove();
    
    		}
    
    		post_id = jQuery('#post_ID').val();
    		tb_show('', 'media-upload.php?post_id='+post_id+'&type=image&TB_iframe=true');
    		return false;
    
    	});
    
    });

    But now in 3.5 it's still displaying the "old" uploader. But I would like to get the new uploader. Do I have to use a completely different code or are it just some small changes?

    Thanks in advance!

  2. webbistro
    Member
    Posted 2 years ago #

    I believe this incredible post will help you. Works like a charm!

    http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/

Topic Closed

This topic has been closed to new replies.

About this Topic