WordPress.org

Make WordPress Core

Ticket #16526: 16526.diff

File 16526.diff, 1.3 KB (added by garyc40, 7 years ago)

Allow iframe in tinymce

  • wp-admin/includes/post.php

    diff --git wp-admin/includes/post.php wp-admin/includes/post.php
    index 510d59f..47377ae 100644
    function wp_tiny_mce( $teeny = false, $settings = false ) { 
    15591559                'paste_text_use_dialog' => true,
    15601560                'wpeditimage_disable_captions' => $no_captions,
    15611561                'plugins' => implode( ',', $plugins ),
     1562                'extended_valid_elements' => apply_filters( 'tiny_mce_extended_valid_elements', 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]' ),
    15621563        );
    15631564
    15641565        if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
  • wp-admin/js/editor.dev.js

    diff --git wp-admin/js/editor.dev.js wp-admin/js/editor.dev.js
    index cf58279..687f0bf 100644
    var switchEditors = { 
    135135        },
    136136
    137137        _wp_Autop : function(pee) {
    138                 var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr';
     138                var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr|iframe';
    139139
    140140                if ( pee.indexOf('<object') != -1 ) {
    141141                        pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){