When parsing an `[embed]` shortcode into a TinyMCE view, don't attempt to append any returned `<script>`s to the editor's `<head>`. This affects only a few supported endpoints: Issuu and Twitter.
See #28195. git-svn-id: https://develop.svn.wordpress.org/trunk@28594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7eb0253744
commit
0b209f55ee
|
@ -677,6 +677,9 @@ window.wp = window.wp || {};
|
|||
} );
|
||||
wp.mce.views.register( 'playlist', wp.mce.playlist );
|
||||
|
||||
/**
|
||||
* TinyMCE handler for the embed shortcode
|
||||
*/
|
||||
wp.mce.embed = {
|
||||
shortcode: 'embed',
|
||||
toView: wp.mce.gallery.toView,
|
||||
|
@ -716,19 +719,8 @@ window.wp = window.wp || {};
|
|||
} ).done( this.setHtml );
|
||||
},
|
||||
setHtml: function ( content ) {
|
||||
var scripts = $( content ).find( 'script' );
|
||||
|
||||
this.parsed = content;
|
||||
|
||||
$( this.node ).html( this.getHtml() );
|
||||
if ( scripts ) {
|
||||
_.each( scripts, function (script) {
|
||||
var element = document.createElement( 'script' );
|
||||
element.type = 'text/javascript';
|
||||
element.src = script.src;
|
||||
tinymce.activeEditor.contentDocument.getElementsByTagName( 'head' )[0].appendChild( element );
|
||||
} );
|
||||
}
|
||||
this.parseMediaShortcodes();
|
||||
},
|
||||
parseMediaShortcodes: function () {
|
||||
|
|
Loading…
Reference in New Issue