Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created December 24, 2012 06:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasgriffin/4368038 to your computer and use it in GitHub Desktop.
Save thomasgriffin/4368038 to your computer and use it in GitHub Desktop.
This is the way you should send content to the TinyMCE Editor in WP 3.5.
// This replaces the old window.send_to_editor function.
wp.media.editor.insert('your_content_goes_here');
@thomasgriffin
Copy link
Author

As a note, this requires that the media-editor.js file be loaded on the page so that the wp.media.editor object is populated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment