• Resolved gdf55

    (@gdf55)


    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

    (@gdf55)

    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.