Make WordPress Core

Ticket #34272: 34272.4.diff

File 34272.4.diff, 1.1 KB (added by swissspidy, 10 years ago)
  • src/wp-includes/class-wp-editor.php

    diff --git src/wp-includes/class-wp-editor.php src/wp-includes/class-wp-editor.php
    index 9a67a48..50e3b94 100644
    final class _WP_Editors { 
    402402                                                'wpdialogs',
    403403                                                'wptextpattern',
    404404                                                'wpview',
    405                                                 'wpoembed',
     405                                                'wpembed',
    406406                                        );
    407407
    408408                                        if ( ! self::$has_medialib ) {
  • new file src/wp-includes/js/tinymce/plugins/wpembed/plugin.js

    diff --git src/wp-includes/js/tinymce/plugins/wpembed/plugin.js src/wp-includes/js/tinymce/plugins/wpembed/plugin.js
    new file mode 100644
    index 0000000..b6efbc9
    - +  
     1(function ( tinymce ) {
     2        'use strict';
     3
     4        tinymce.PluginManager.add( 'wpembed', function ( editor, url ) {
     5                editor.on( 'init', function () {
     6                        var scriptId = editor.dom.uniqueId();
     7
     8                        var scriptElm = editor.dom.create( 'script', {
     9                                id: scriptId,
     10                                type: 'text/javascript',
     11                                src: url + '/../../../wp-embed.js'
     12                        } );
     13
     14                        editor.getDoc().getElementsByTagName( 'head' )[ 0 ].appendChild( scriptElm );
     15                } );
     16        } );
     17})( window.tinymce );