Once tinymce is loaded onto the admin page you want to work with, just use the code below to replace a textarea with the tinymce editor.
Check out this blog ( http://blog.zen-dreams.com/en/2009/06/30/integrate-tinymce-into-your-wordpress-plugins/ ) for info about getting the neccessary code in the head of your page if you are not adding text boxes to the page or post sections of the admin interface.
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready( function () {
jQuery("#my_plugin_textarea").addClass("mceEditor");
if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) {
tinyMCE.execCommand("mceAddControl", false, "my_plugin_textarea");
}
});
/* ]]> */
</script>
<textarea name="my_plugin_textarea" id="my_plugin_textarea"></textarea>
One Response to WordPress Tinymce text fields (raw HTML and JS code)