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

I want to add some custom fields to allow a user to select items from the Media library for the custom post (in the add/edit view)

Is there a way to do this?

share|improve this question
up vote 3 down vote accepted

My answer will be in the form of links.

The WPAlchemy meta box class supports this: http://www.farinspace.com/wpalchemy-metabox/ + tutorial http://www.farinspace.com/wordpress-media-uploader-integration/

A tutorial on how to do it, mainly javascript: http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/

share|improve this answer
thats cool. I dont really like the idea of having someone elses classes on there. just a simple howto. but i guess this works – qodeninja May 19 '11 at 22:07

You could add

<a href="#" class="button insert-media add_media" data-editor="content" title="Add Media">
    <span class="wp-media-buttons-icon"></span> Add Media

to a metabox

share|improve this answer

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.