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'm using a very lightweight plugin called WPAlchemy that lets me rapidly create meta-boxes for posts and pages. I've ben able to convert <textarea>'s into rich, TinyMCE's editors just fine. The problem is, I'd like to include the Media Upload buttons for those metaboxes / editors.

I've been able to add the buttons above each TinyMCE editor but when I click "Insert into Post" it isn't (has no idea) which <textarea> to insert the requested picture/media. For reference, I'm adding the following line above my <textarea>:

<div id="media-buttons" class="hide-if-no-js"><?php do_action( 'media_buttons' ); ?></div>

I'm aware this isn't valid since I'm using the same id, (#media-buttons) as what the default content editor uses at the top.

Someone suggested the following JS code to kinda hook and grab the src but I can't get this working for my scenario. (Suggestions came from here http:(slash)(slash)farinspace.com/multiple-wordpress-wysiwyg-visual-editors/comment-page-1/#comment-3552)

Finally, I'm attaching an image of what it currently looks like, but it just doesn't link the "Insert Into Post" button with the currently focused metabox. Image: http:(slash)(slash)cl.ly/4BMf

Any help, please?

share|improve this question
up vote 1 down vote accepted

Here is a complete tutorial with source files that do exactly what you want,
You can upload multi images by cloning the input field and also you can preview, delete images with ajax, add multi metaboxes to multiple/different post types and more.


And here you can find some good information on how you call the attached images,

share|improve this answer
Thanks Philip! This is exactly what I was looking for. – Mike B. Jan 26 '11 at 7:48
Glad you find the way @Mike B., happy coding! – Philip Jan 26 '11 at 8:00

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.