2
votes

How can i set the tinyMCE editor in wp_editor to not modify/replace the html tags of the initial content ?

I'm loading html content with < b > tags (i know that they are deprecated but i need them) and the tinyMCE editor is replacing them.

I tried several things but with no success. I'm getting a little frustrated. I need help.

What i need is that the editor do not change the loaded html content.

Sorry for my bad english! It's not my native language.

Thanks in advance !

2

2 Answers

1
votes

Looks like tinymce stripps some html tags out, which tinymce does not recognize as "valid". You will need to set your tinymce config to keep those html elements (make them valid).

There are the following tinymce settings for this:

  • valid_elements (defines which html elements are valid + valid attributes)
  • valid_children (defines which combinations of parent and child elements are valid)
0
votes

just change the attributes to

    valid_children : "+a[div|h1|h2|h3|h4|h5|h6|p|#text]", (defines which html elements are valid + valid attributes)
    valid_elements : '*[*]', (defines which combinations of parent and child elements are valid)