title: Wordpress media button "insert into post" not returning file url
body: <p><img src="https://i.stack.imgur.com/UrpXE.png" alt="enter image description here">I have created a custom field where media file url/location is stored using wordpress standard media gallery pop up by clicking "insert into post" button. Below is my code to extract the path of the media file. Image url is working fine. But it is returning only media title. I don't know where can I get the file path from.</p>
  
  <pre><code>jQuery(document).ready(function() {
      jQuery('#wsp_media_button').click(function() {
       formfield = jQuery('#wsp_media').attr('name');
       tb_show('', 'media-upload.php?TB_iframe=true&amp;amp;tab=library');
       return false;
      });
  
      window.send_to_editor = function(html) {
          var imgurlar = html.match(/&lt;img[^&gt;]+src=\"([^\"]+)\"/);
          var imgurl = imgurlar[1];
  
          //html is returning only title of the media
          alert(html);
  
          //image
          if( imgurl.length ){
              jQuery('#wsp_media').val(imgurl);
          }
          //other types of files
          else{
              var fileurl = jQuery(html);
  
          }
      }
  });
  </code></pre>