views:

237

answers:

1

Basically need the default Wordpress TinyMCE WYSIWYG editor where the user will enter some formatted text in my plugin. How do I integrate/implement TinyMCE in a simple HTML Wordpress form??

I'm using Wordpress v2.9!

+1  A: 

The function you are looking for is wp_tiny_mce

Here is how to include the editor in one of your plugin’s admin panel.

  1. Include this code in the admin_head hook

    add_filter('admin_head','zd_multilang_tinymce');

    function zd_multilang_tinymce() { wp_admin_css('thickbox'); wp_print_scripts('jquery-ui-core'); wp_print_scripts('jquery-ui-tabs'); wp_print_scripts('post'); wp_print_scripts('editor'); add_thickbox(); wp_print_scripts('media-upload'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); // use the if condition because this function doesn't exist in version prior to 2.7 }

  2. Call the editor anywhere you need it to be displayed

    the_editor($content_to_load);

Courtesy of http://blog.zen-dreams.com/en/2008/11/06/how-to-include-tinymce-in-your-wp-plugin/

Lars Koudal