Search code examples
tinymcewordpresswordpress-theming

Using TinyMCE Advanced with plugin's textarea - Wordpress


I'm developing a custom plugin in Wordpress. I also have the TinyMCE Advanced Wordpress plugin activated and working.

I created a normal HTML textarea, and converted it into a TinyMCE WYSIWYG editor, using the class="theEditor" attribute. The problem is, it's Wordpress' own TinyMCE implementation, and NOT the TinyMCE Advanced plugin's implementation, which means I miss out on all its features, including the (most important for my purposes) "stop removing <p> and <br> tags" option.

How do I make the textarea trigger TinyMCE Advanced?


Solution

  • You should have a look at these two articles:

    • http://allcreatives.net/2011/02/02/using-the-native-wordpress-tinymce-wysiwyg-editor-with-your-custom-post-meta-textareas/
    • http://www.keighl.com/2010/01/tinymce-in-wordpress-plugins/

    And check the the_editor (/wp-includes/general-template.php -> line 1771) and the wp_tiny_mce (/wp-admin/includes/post.php -> line 1377) functions too.

    Updated the links

    These links are dead, but can be reached in the internet archive here:

    allcreative.net page

    keighl.com page