I am simply trying to retain my <u>
tags and <b>
tags, in wp admin post editor.
However when switching back and forth from the visual view to the text/html view they are being changed to <span style="text-decoration: underline;"></span>
this is annoying and spans in my case would be problematic.
what is the best way to go about this, I have tried some plugins which aren’t of help and adding and extending valid elements … but have not succeeded as of yet!
It would be of great help if some of you geniuses could point me in the right direction.
Also a different question I have;
Is there a simple way to add a style button to the text editor that will change the direction of the form in the text view of the editor from ltr and rtl,
I have done this easily via changing the css in the developer tools or firebug! but am asking for something built in!
You simply have to disable the
inline_styles
option (which is turned on by default in the version of TinyMCE that’s included with WordPress):Although this works, I’d strongly advise against it. This use of the
u
element has been deprecated in HTML5, and is considered non-semantic in this context.If you can explain why you’re trying to do this, maybe we can come up with a better solution.
P.S. There’s a great discussion about this over at the TinyMCE forums.
I’m relatively new to all this and I couldn’t figure out how to do this so, here is the code. Pulled it from the core class-wp-editor.php file. Here it is:
PLEASE NOTE: It only changes the behavior of underline button, if you want bold, italic as
b
andi
tags, add @Thariama’s comment to the code.You may simple init your editor with the following
Tinymce will then treat bold, italic underline as b,u and i-tags.