2
votes

I'm using the CKEditor as default editor and I want to integrate the TinyMCE editor for a plugin. This is my code:

function tiny_page() {
    add_options_page(‘tiny’, ‘tiny’, ‘manage_options’, __FILE__, ‘tiny_form’);
}

add_action(‘admin_menu’, ‘tiny_page’);

/* load the tiny editor*/
function editor_admin_init() {
    wp_enqueue_script(‘word-count’);
    wp_enqueue_script(‘post’);
    wp_enqueue_script(‘editor’);
    wp_enqueue_script(‘media-upload’);
}

function editor_admin_head() {
    wp_tiny_mce();
}

add_action(‘admin_init’, ‘editor_admin_init’);
add_action(‘admin_head’, ‘editor_admin_head’);

/* output the plugin page*/
function tiny_form() {
    $args = array(“textarea_rows” => 5, “textarea_name” => “editor_content_1?);
    wp_editor(“My editor content”, “my_editor_1?, $args);
}

The problem is that the output plugin editor is the CKEditor and not the tiny one…

Any ideas?

1

1 Answers

0
votes

From Wordpress' WP Editor documentation:

Note that the ID that is passed to the wp_editor() function can only be comprised of lower-case letters. No underscores, no hyphens. Anything else will cause the WYSIWYG editor to malfunction.

Try changing "my_editor_1" to "mycustomeditor" or something unique that follows the documentation's standards.