title: Wordpress select image from Media Library
body: <p>I create one theme for wordpress and on admin panel, I need to select image (Logo) from media library by admin site. I use this code but not work:</p>
  
  <pre><code>&lt;?php
  add_action ('admin_enqueue_scripts', function() {
      if(is_admin())
      wp_enqueue_media(); 
  });
  ?&gt;
  &lt;form method="post"&gt;
      &lt;input type="text" class="process_custom_images" id="process_custom_images" name="selected_logo" value="" placeholder="http://"&gt;
      &lt;button class="set_custom_logo button" style="vertical-align: middle;"&gt;Select Logo&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  //“Add Media” button
  jQuery(document).ready(function() {
      var $ = jQuery;
      if ($('.set_custom_logo').length &gt; 0) {
          if ( typeof wp !== 'undefined' &amp;&amp; wp.media &amp;&amp; wp.media.editor) {
              $(document).on('click', '.set_custom_logo', function(e) {
                  e.preventDefault();
                  var button = $(this);
                  var id = button.prev();
                  wp.media.editor.send.attachment = function(props, attachment) {
                      id.val(attachment.url);
                  };
                  wp.media.editor.open(button);
                  return false;
              });
          }
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>But when I insert below code inside <code>form</code> tag, above code working well.</p>
  
  <pre><code>&lt;div&gt;&lt;?php wp_editor("", 'postcontent', $settings = array('textarea_rows'=&gt; '10')); ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But I don't need text editor!
  Please help me.
  Thank's</p>