Ticket #16526: 16526.diff

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

Allow iframe in tinymce

Line 
1diff --git wp-admin/includes/post.php wp-admin/includes/post.php
2index 510d59f..47377ae 100644
3--- wp-admin/includes/post.php
4+++ wp-admin/includes/post.php
5@@ -1559,6 +1559,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
6                'paste_text_use_dialog' => true,
7                'wpeditimage_disable_captions' => $no_captions,
8                'plugins' => implode( ',', $plugins ),
9+               '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]' ),
10        );
11 
12        if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
13diff --git wp-admin/js/editor.dev.js wp-admin/js/editor.dev.js
14index cf58279..687f0bf 100644
15--- wp-admin/js/editor.dev.js
16+++ wp-admin/js/editor.dev.js
17@@ -135,7 +135,7 @@ var switchEditors = {
18        },
19 
20        _wp_Autop : function(pee) {
21-               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';
22+               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';
23 
24                if ( pee.indexOf('<object') != -1 ) {
25                        pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){