Call TinyMCE in a WordPress plugin

后端 未结 8 1338
悲哀的现实
悲哀的现实 2020-12-24 05:33

Is there a way to add TinyMCE into my own WordPress plugin?

I have a textarea in my back end script and want to make this area into a TinyMCE WYSIWYG editable field.

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 06:12

    I had a similar problem, and class="theEditor" didn't help me either (at first). I was using a custom post type which didn't include the default editor (ie the supports argument didn't include 'editor').

    That meant WordPress didn't include the TinyMCE code. Once I added

    add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
    

    to my functions.php (based on the code in the the_editor function in general-template.php) it worked fine (with class="theEditor").

提交回复
热议问题