0

I recently started using this nifty meta box framework: http://www.deluxeblogtips.com/meta-box-script-for-wordpress/

I really like the plupload meta box, however, I need to be able to add the uploaded image into the editor rather than just attaching it to the post.

Any idea how I can create a button that inserts the correct attachment into the editor like it works with the regular "insert into post" button when uploading using the regular uploader?

1 Answer 1

1

You can add content to the editor via javascript:

tinyMCE.activeEditor.selection.setContent('<img src="hello.jpg">');
2
  • Thanks for your reply. I googled around, all I could find is how to incorporate that code into a button in TinyMCE. How can I make a link within my metabox that sends images to the editor?
    – INT
    Commented Jun 25, 2012 at 9:49
  • attach that javascript to the link in your metabox with an onclick or jQuery's click handler and pass whatever content you want inserted.
    – Milo
    Commented Jun 25, 2012 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.