- if ( ed && !ed.isHidden() ) {
- // restore caret position on IE
- if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
- ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
-
- if ( h.indexOf('[caption') !== -1 ) {
- if ( ed.wpSetImgCaption )
- h = ed.wpSetImgCaption(h);
- } else if ( h.indexOf('[gallery') !== -1 ) {
- if ( ed.plugins.wpgallery )
- h = ed.plugins.wpgallery._do_gallery(h);
- } else if ( h.indexOf('[embed') === 0 ) {
- if ( ed.plugins.wordpress )
- h = ed.plugins.wordpress._setEmbed(h);
- }
-
- ed.execCommand('mceInsertContent', false, h);
- } else if ( qt ) {
- QTags.insertContent(h);
+ if ( editor && ! editor.isHidden() ) {
+ editor.execCommand( 'mceInsertContent', false, html );
+ } else if ( hasQuicktags ) {
+ QTags.insertContent( html );