Integrate tinyMCE into your wordpress plugins
You might remember that I wrote a previous article about the integration of tinyMCE into your wordpress plugins for version 2.5 to 2.7.1.
Following some of your requests and due to the fact that I had to look in order to make ZdMultilang work with the latest Wordpress, Here is the updated article with explanation of how to integrate tinyMCE into your wordpress plugins.
So here is the code you need to include.
add_filter('admin_head','ShowTinyMCE');
function ShowTinyMCE() {
// conditions here
wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
wp_print_scripts('editor');
if (function_exists('add_thickbox')) add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
wp_admin_css();
wp_enqueue_script('utils');
do_action("admin_print_styles-post-php");
do_action('admin_print_styles');
}
Don’t ask me to explain everything, I just found all these details while browsing the admin pages related to posts.
Français









jason
6 August 2009
does this work in wp 2.8.3? i cant seem to get it to work with just what you have above.
Anthony
6 August 2009
Yes, it is working with 2.8.3
jason
6 August 2009
i have a plugin that uses the code you have from above. and i can see the javascript and the stylesheets, however, the form does not display. do i need to put a textbox or an include box on the page with a certain id or name to get it to work? thanks for the help btw.
Antone Roundy
26 October 2009
Thanks for posting this code.
One question — when creating a plugin that you want to have able to run on various WordPress versions, can you use the code shown on this page, or does the plugin need to detect the WordPress version and call the code from your former post if it’s on an old version? If so, do you know how to check the WordPress version (I did some searching and couldn’t find anything).
One other question: in your previous post, most of the code for the two versions was the same except that the order of the function calls was different — is there any significance to that?
Thanks again.