Guest User

Calling Wordpress Build In Media Manager / Uploaded on button click

a guest
Aug 28th, 2010
289
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery.noConflict();
  2. jQuery(document).ready(function($) {
  3.  
  4. var ww = $('input[name=post_ID]').val();
  5. var which_button;
  6.  
  7. $('.meta_upload_button').each(function() {
  8.  
  9.     var button = $(this);
  10.  
  11.     $(this).click(function() {
  12.         which_button = button;
  13.         window.send_to_editor=window.send_to_editor_clone;
  14.         tb_show('', 'media-upload.php?post_id=' + ww + '&type=image&TB_iframe=true');
  15.         return false;
  16.     });
  17.  
  18.  
  19.     window.send_to_editor_clone = function(html){
  20.         imgurl = $('img',html).attr('src');
  21.         forminput = which_button.prev('input');
  22.         forminput.val(imgurl);
  23.        
  24.         tb_remove();
  25.     }
  26.  
  27. }); //end each
  28.  
  29.  
  30. }); //end document ready
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×