I want to use tinyMCE in my wp-admin to replace textareas. More specifically, for my custom meta boxes where I want to simply use instead of more complicated tinymce-specific php code.
So, I put tinymce in the wp-admin folder, and loaded it into admin-header.php, and it succesfully loads it when I go to one of the edit-page pages, except it instead of turning the textareas into tinymce editors, it makes the textareas (all but one, for some reason?) turn invisible. Only errors console gives me is that “undefined is not a function” in tiny-mce.js, and that “ajaxurl is not defined” in load-scripts.js.
What could I be doing wrong? The javascript for tinymce is the most basic there is:
<script type="text/javascript" src="/wp-admin/tinymce/jscripts/tiny_mce/tiny_mce.js" > </script >
<script type="text/javascript" >
tinyMCE.init({
mode : "textareas",
theme : "simple" //(n.b. no trailing comma, this will be critical as you experiment later)
});
</script >
Only things I can think of:
- Doesn’t function well in admin-header.php
- The metaboxes file I made thinks tinymce is a bad choice
- ???
But that doesn’t really give me any options… And I’m sick of trying to get tinymce to work within my metaboxes file.
Replacing the wp-admin and wp-includes folders again made it work, not sure why it didn’t the first time. Solved!