18 lines
445 B
JavaScript
18 lines
445 B
JavaScript
(function ( tinymce ) {
|
|
'use strict';
|
|
|
|
tinymce.PluginManager.add( 'wpoembed', function ( editor, url ) {
|
|
editor.on( 'init', function () {
|
|
var scriptId = editor.dom.uniqueId();
|
|
|
|
var scriptElm = editor.dom.create( 'script', {
|
|
id: scriptId,
|
|
type: 'text/javascript',
|
|
src: url + '/../../../wp-embed.js'
|
|
} );
|
|
|
|
editor.getDoc().getElementsByTagName( 'head' )[ 0 ].appendChild( scriptElm );
|
|
} );
|
|
} );
|
|
})( window.tinymce );
|