Replacing a textarea with WordPress TinyMCE wp_editor()
I've followed the above guide, but the WYSIWYG has some issues.
$text = str_replace(array("\r", "\n"), '', $instance['text']);
$settings = array( 'textarea_name' => $this->get_field_name('text') );
wp_editor( esc_attr( $text ), 'text', $settings );
The result is this:
The tab wont switch (sometimes Text is selected initially, sometimes Visual). The Add Media button appears to work, but when clicking Insert into Post, the modal disappears and nothing happens.
There's nothing in the console, so I'm not sure what's going wrong. Might someone know what is happening, or perhaps what direction to move in order to start figuring it out?