Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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.

http://www.deluxeblogtips.com/2010/05/howto-meta-box-wordpress.html

And here you can find some good information on how you call the attached images,
http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/

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

 
discard

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.