如何只在<code> tags, except for <pre><code> tags?

时间:2017-11-02 15:39:09

标签: wordpress html-escape-characters

I used some code in WordPress Posts, but some characters have been escaped. Sometimes I just want &lt; keep showing like that, instead of <.

I am also currently using prism.js, so I want those code between <pre><code> and </code></pre> keep escaping, but those between <code> and </code> to unescape.

1 个答案:

答案 0 :(得分:0)

add_filter('tiny_mce_before_init', function( $a ) {
    $a["extended_valid_elements"] = 'ADD TAGS YOU NEED TO BE ALLOWED IN THE EDITOR HERE';
    return $a
});