Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method:

wp_editor($text, $this->get_field_id('text'));   

seems to work. But after you press the “Save” button the widget goes funky…

Adding _WP_Editors::editor_js(); makes it show after you press the save button, but then other things start to act weird. I think it has something to do with the javascript from the footer.

Has anyone successfully integrated wp_editor inside a widget?

3 Answers
3

As said I think it’s quite hard to find a reliable solution because you have to take care of so many things.
I go either for the way proposed by Danny van Kooten:
http://dannyvankooten.com/450/tinymce-wysiwyg-editor-in-wordpress-plugin/

add and open the editor in a thickbox or another way I’ve used once, using the widget “accessibility mode” for “advanced” stuff as seen in this screenr: http://www.screenr.com/sY5s

this example is buggy but the overall concept works fine, even if it’s quite funny that you have to use js to get and add the link to the corresponding (non-js fallback) widget-edit page 🙂

But on the other hand, on this seperate page you can actually do whatever you want.

Leave a Comment