Adding wp_editor to custom WP widget

I want to add WP editor with TinyMCE to my custom text widget, but it won’t show TinyMCE buttons it just shows textarea.

When I test my code on page.php it works perfectly – editor shows with all the buttons and metabox.

Read More

Can You please tell me what I’m doing wrong?

EDIT
Widgets screenshot.
Same code used in page.php screenshot

The code I use :

$settings = array(
    'wpautop' => true,
    'media_buttons' =>  false,
    'textarea_name' => 'test-editor',
    'textarea_rows' => get_option('default_post_edit_rows', 10),
    'tabindex' => '',
    'editor_css' => '',
    'editor_class' => '',
    'teeny' => true,
    'dfw' => true,
    'tinymce' => array(
          'theme_advanced_buttons1' => 'bold,italic,underline' 
    ),
    'quicktags' => false
);
wp_editor( 'Text in editor', 'test-editor', $settings );

Related posts

Leave a Reply

1 comment

  1. Looks like you need to find another WYSIWYG editor. Reading the Codex, there are two issues with your code:

    1. The $editor_id

      can only be composed of lower-case letters. No underscores, no hyphens. Anything else will cause the WYSIWYG editor to malfunction.

    2. And this one that prevents the editor from working in a meta box

      Once instantiated, the WYSIWYG editor cannot be moved around in the DOM. What this means in practical terms, is that you cannot put it in meta-boxes that can be dragged and placed elsewhere on the page.