I want to implement TinyMCE in my Wordpress plugin. AS?

In principle, you need a standard WordPress TinyMCEWYSIWYG editor in which the user enters some formatted text in my plugin. How to integrate / implement TinyMCEHTML Wordpress in a simple form?

I am using Wordpress v2.9!

+3
source share
1 answer

The function you are looking for is wp_tiny_mce. Here's how to include the editor in one of the plugin admin panels.

  • Include this code in admin_headhook

    add_filter('admin_head','zd_multilang_tinymce');
    
    function zd_multilang_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();
        // use the if condition because this function doesn't exist in version prior to 2.7
    }
    
  • Call the editor anywhere to display

    the_editor($content_to_load);
    

Source

+2
source

Source: https://habr.com/ru/post/1735419/


All Articles