mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-30 07:20:01 +01:00
ae58f104cb
Props swissspidy. Fixes #34272. Built from https://develop.svn.wordpress.org/trunk@35397 git-svn-id: http://core.svn.wordpress.org/trunk@35361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
18 lines
444 B
JavaScript
18 lines
444 B
JavaScript
(function ( tinymce ) {
|
|
'use strict';
|
|
|
|
tinymce.PluginManager.add( 'wpembed', 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 );
|