I am trying to add a rich text editor to a widget and am using CKEditor ( http://ckeditor.com/download ) with a simple toolbar.

Everything works fine until I try to save. When clicking on "save" the textarea (and texteditor) vanish and it fails to save.

Removing the texteditor allows the textarea to work and save normally.

You can see the widgets code here: http://pastebin.com/C7VbxBSG

and of course I did add the required wp_register_script and wp_enqueue_script

I use the same code to add the text editor to text areas n meta boxes for pages and posts and it works fine. It's just on the widget the problem comes up something to do with the way the widget saves: via javascript which is beyond my skills at present

2 Answers 2


I had the same problem when adding tinymce to widgets a few months ago. Add all your javascript code with enqueue script, instead of adding it in each widget instance.

Here is my tinymce implementation: http://gist.github.com/600616

  • That would be awesome, please do! Commented Sep 28, 2010 at 7:42
  • Actually, can you enqueue scripts that are meant to be called inline? The script in question is on line 101 in the pastebin link: ( pastebin.com/C7VbxBSG ) Can that be enqueued? Commented Sep 28, 2010 at 8:26
  • I added a link to my code in the answer. You can see how I added the code in the header (I could have used an enqueue script instead). To do it, you will have to use a class instead of the id to call the script (since the field id is dynamically generated).
    – sorich87
    Commented Sep 28, 2010 at 8:36
  • Brilliant, I am going to dig into this tonight. Thanks! Commented Sep 28, 2010 at 9:15

You may want to try the Black Studio TinyMCE Widget plugin, which adds a WYSIWYG text widget based on the standard TinyMCE WordPress editor (not CKEditor).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.