Is there a way to give oEmbed codes a special markup in the visual editor? In my dream implementation you paste an oEmbed-enabled url in the editor, which will then automatically replace it with a thumbnail of the media object you want to insert. A basic implementation would at least highlight the URL so the user knows "something special" could happen there (if no errors occur).

Is there a plugin that does this? I could create something like this myself, but I would need some pointers on how to hook into the TinyMCE editor in the most WordPress-stylish way.

  • Hi Jan, did you find any good solution for this by chance? I am very interested in doing the same thing but my focused would be shortcodes mainly because when you try to explain to someone these shortcodes and how they work they often time screw things up or don't understand how it works. I am also curious... if one can have the shortcode replaced with a box then should it not be possible to have the sortcode replaced with some "virtual" html or an inline iframe which contains the html? – NetConstructor.com Nov 19 '10 at 13:55
  • @NetConstructor.com: I have not found anything yet, but it should be possible to do this with shortcodes. I know the [gallery] shortcode gets a nice layout when you switch from the HTML to the visual editor, probably that TinyMCE plugin could be extended to other shortcodes too. – Jan Fabry Nov 19 '10 at 14:24
  • Mental note for myself: there is commented-out code for this in the WordPress plugin for TinyMCE. – Jan Fabry Feb 13 '11 at 18:21

I think this might be a step in the right direction:


Specifically the the_editor_content filter which is "applied to post content before putting it into a rich editor window."

Sorry I can't flesh it out more for you but I am just starting to play around with filters myself and have miles to go before I can be useful.

  • Thanks for the answer. I think I'll need to look at the TinyMCE events, since I also need to switch the text between the Visual and the HTML editor. For inspiration, I'm looking at the plugin that handles Flash embeds. In the HTML editor you see the embed code, in the visual editor you see a box. – Jan Fabry Sep 28 '10 at 9:40
  • Your welcome. Please post your solution here when you have it I would be very interested to see the final result – Ashley G Sep 28 '10 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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