0

I am writing a plugin and have this code:

$settings = array("media_buttons" => false, "wpautop" => false, "teeny" => true);
wp_editor("", "viddesc", $settings);

The problem is when I paste this in wp editor:

<span class='infoTitle'>Nulla mauris justo</span>

And save it, it becomes this:

<p>&lt;span class='infoTitle'&gt;Nulla mauris justo&lt;/span&gt;</p>

Is there a away to avoid adding p tags and converting <> characters?

Thank you.

1 Answer 1

2

If you use Text editor, instead of Visual editor, you will add exactly the html code you wanted to add there. It has nothing to do with the PHP code you mentioned, just html from visual editor is transformed in the way you get it later (< and > and so on).

3
  • Ok, I see now. Is there a way to disable (remove?) visual part? Because this way it completely brakes my applications. Or maybe there is something better for me to use to paste html code and save it later.
    – Toniq
    Commented Dec 26, 2014 at 14:58
  • Yes, in your user profile page you can totally disable visual editor.
    – vlood
    Commented Dec 26, 2014 at 14:58
  • 1
    If you want this disabled for the rest of the users in the site, just add this in your theme's functions.php or in a new plugin: add_filter('user_can_richedit', false);
    – vlood
    Commented Dec 26, 2014 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.