TinyMCE in WordPress Plugins

I’ve been to the edge of the internet and back, before I found this tidbit of code that will allow you to use TinyMCE in your WordPress plugins!

1. Add the following code to your plugin

add_filter('admin_head','myplugin_tinymce');
 
function myplugin_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(); }
}

2. Call the editor in your plugin

the_editor($content_to_load);
Read More...