WYSIWYG editor generated by Wp_editor is disabled

Initial issue:

My client wanted an custom HTML rendering sidebar widget for their wordpress site. I created a simple one that allows them to choose the color (class switching) and gives them a textarea to put their HTML into. Now they have requested a basic WYSIWYG interface attached to it (CKEditor or TinyMCE) but I dont know how to add it to the textarea inside the widget code. Does anyone know how, have an example, or a place to see how it can work? Thanks!

Read More

EDIT (After use of wp_editor):

So I have my code to this point but the editor is disabled and not able to be used. Any ideas why?

<fieldset>
    <label>Enter your HTML</label>

    <?php 
    $settings = array(
        'wpautop' => true,
        'media_buttons' => false,
        'tinymce' => array(
            'theme_advanced_buttons1' => ',bold,italic,underline,|,link,unlink',

        ),
        'quicktags' => false
    );
    $bodyID = $this->get_field_id('body');
    $content = '';
    wp_editor($content, $bodyID, $settings );
    ?>
    </fieldset>

Related posts

Leave a Reply

1 comment

  1. Use wp_editor function, your code will look something like this:
    http://codex.wordpress.org/Function_Reference/wp_editor

     <fieldset>
    
        <label> Your label for the text area </label>
    
        <?php 
        $settings = array(
            'wpautop' => true,
            'media_buttons' => false,
            'tinymce' => array(
                'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
                    'bullist,blockquote,|,justifyleft,justifycenter' .
                    ',justifyright,justifyfull,|,link,unlink,|' .
                    ',spellchecker,wp_fullscreen,wp_adv ',
    
            ),
            'quicktags' => false
        );
        wp_editor('initial content', 'id of textarea', $settings );
        ?>
        </fieldset>
    

    Note that if you want to put the content in the WP database from front end you should use in addition wp_insert_post function and a POST varible as a link.