﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
20264,WP_Editor unexpected behavior/bug when used in widget,niklasbr,,"Creating a bare bones widget using the wp_editor() function only returns a non-functioning editor (a few times no editor at all). Using the setting teeny => true results in a javascript error where wp_editor will try to load /wp-includes/js/tinymce/themes/simple/editor_template.js (which does not exist).


A demo video of this behavior can be found here: https://vimeo.com/38863361

This is the demo code:
{{{
add_action('widgets_init', 'my_widgets_add');
function my_widgets_add() {
    register_widget('my_wysiwyg_widget');
}
class my_wysiwyg_widget extends \WP_Widget {
    function __construct() {
        $widget_ops = array('classname' => 'my_wysiwyg_widget', 'description' => __('My WYSIWYG Widget'));
        $control_ops = array('width' => 650, 'height' => 350);
        parent::__construct(false, __(""My WYSIWYG Widget""), $widget_ops, $control_ops);
    }
    
    function form() {
        // Create a TinyMCE editor
        wp_editor('content',
            $editor_id = ""unique_id_goes_here"", 
            $settings = array(
            'textarea_name' => ""unique_name_goes_here"",
            'textarea_rows' => 7,
            teeny => false));
    }
    
    function update($new_instance, $old_instance) {
        // Save data later
        $instance = $old_instance;
        return $instance;
    }
    
    function widget($args, $instance) {
        // print later
    }    
}
}}}",defect (bug),new,normal,Awaiting Review,TinyMCE,3.3.1,major,,,info@…
