nicomonjelat
nicomonjelat

Reputation: 165

TinyMCE editor in wp_editor is removing my html tags

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 !

Upvotes: 2

Views: 2387

Answers (2)

Minu Alex
Minu Alex

Reputation: 117

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)

Upvotes: 0

Thariama
Thariama

Reputation: 50840

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)

Upvotes: 1

Related Questions