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!
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>
Use
wp_editor
function, your code will look something like this:http://codex.wordpress.org/Function_Reference/wp_editor
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 aPOST
varible as a link.