Title: detect tinymce editor type
Last modified: August 20, 2016

---

# detect tinymce editor type

 *  Resolved [gdf55](https://wordpress.org/support/users/gdf55/)
 * (@gdf55)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/detect-tinymce-editor-type/)
 * I’m writing a media plugin with tinyMCE hooks that produces some fairly complex
   HTML. If the HTML is present, I can use onBeforeSetContent to convert it to something
   the visual editor can work with, and onGetContent to convert it from visual back
   to HTML.
 * Unfortunately, the media_send_to_editor function just puts the string back in
   the active editor. What I need to do is detect WHICH editor is in use (HTML or
   Visual) and return the correct string. Anyone else done this successfully?

Viewing 1 replies (of 1 total)

 *  Thread Starter [gdf55](https://wordpress.org/support/users/gdf55/)
 * (@gdf55)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/detect-tinymce-editor-type/#post-2340598)
 * Realized (middle of the night, I hate it when that happens) that it must be a
   WP setting, not a tinyMCE setting, that determines the editor. Found a function
   wp_default_editor() that returns “html” or “tinymce” depending on a stored cookie
   or user default setting.

Viewing 1 replies (of 1 total)

The topic ‘detect tinymce editor type’ is closed to new replies.

## Tags

 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [media](https://wordpress.org/support/topic-tag/media/)
 * [tinymce](https://wordpress.org/support/topic-tag/tinymce/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [gdf55](https://wordpress.org/support/users/gdf55/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/detect-tinymce-editor-type/#post-2340598)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
