Use HTML in TinyMCE Editor


I want to use HTML ( in my TinyMCE Editor. I use the following script in my custom.php

// Prevent TinyMCE from stripping out metadata
function schema_TinyMCE_init($in)
     *   Edit extended_valid_elements as needed. For syntax, see
     *   NOTE: Adding an element to extended_valid_elements will cause TinyMCE to ignore
     *   default attributes for that element.
     *   Eg. a[title] would remove href unless included in new rule: a[title|href]
        $in['extended_valid_elements'] .= ',';

    $in['extended_valid_elements'] .= '@[id|class|style|title|itemscope|itemtype|itemprop|datetime|rel],div,dl,ul,dt,dd,li,span,meta,content,a|rev|charset|href|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],div[*],meta[*],span[*],meta[itemprop],meta[content]';

    return $in;
add_filter('tiny_mce_before_init', 'schema_TinyMCE_init' );

The code works for some elements like <span itemprop="name">but nor for <meta itemprop="uploadDate" content="2015-12-15T10:10:04.000Z"/>

Why doesn’t it work for meta itemprop="..." content="..."

tom84 8 years 2015-12-15T06:13:59-05:00 0 Answers 102 views 0

Leave an answer