Ok apparently WordPress keeps track of what kind of editor (visual or html) is active as a class which is added to the content wrapper so here is a solution that will get you the latest content in the editor
function get_tinymce_content(){
if (jQuery("#wp-content-wrap").hasClass("tmce-active")){
return tinyMCE.activeEditor.getContent();
}else{
return jQuery('#html_text_area_id').val();
}
}
Related Posts:
- Creating a wp_editor instance with custom tinyMCE buttons
- Remove HTML editor and visual/HTML tabs from TinyMCE
- Load wp_editor via ajax [duplicate]
- TinyMCE 4.x : How to customize toolbar on wp_editor()
- How to use the new Dashicons for custom TinyMCE buttons?
- Add unique class or ID information to tinyMCE
- TinyMCE Anchor Button not showing
- “wp_editor” not displaying TinyMCE correctly when square brackets used in name
- Secure Validation of wp_editor in Theme Options
- Tiny MCE not adding p tag when saving theme option
- TinyMCE Editor Set Default Tab
- Registering custom TinyMCE buttons, for admin area, to work with custom instances of wp_editor
- Remove quicktag buttons but not Visual / Text editor and tabs
- TinyMCE editor – new lines not rendered on front end
- How to get WP editors tinyMCE instances
- TinyMCE strips line breaks on mceAddControl
- Count Words using tinymce in the front-end
- tinyMCE.activeEditor = null WP editor loaded in ‘Text’ mode?
- Add table controls with wp_editor minimal editor configuration (‘teeny’)
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- TinyMCE Plugin Parameter
- wpeditor issue – shows both mode and not able to focus/edit during visual mode
- wp_editor on input changes content
- Limit Block format tags in WordPress wp_editor
- How to remove the statusbar from the default wordpress editor?
- wp.editor.initialize does not show the same default toolbar
- Stop WordPress Visual Editor converting backticks into code blocks
- TinyMCE Editor change underline button behavior – u tag instead of span text-decoration underline
- wordpress qtranslate editor text is not working [closed]
- Is it possible to disable the image alignment options in the post editor?
- How to dynamically generate wordpress editor on frontend?
- Change syntax styling of TinyMCE HTML Text Editor
- More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks
- Adding custom styles to elements, without creating new elements
- wp_editor not modify html tags of initial content
- allowing all HTML tags in tinymce editor
- How to apply a custom skin to WP_Editor / TinyMCE?
- Stop editor from adding “amp;” after every “&”
- TinyMCE 4 & wp_editor multiple editor issue
- How to remove buttons from tinyMCE in wp_editor added via AJAX
- Loading a self-hosted custom @font-face into TinyMCE dropdowns (Classic Editor) via ‘tiny_mce_before_init’ filter
- Load WordPress Editor .css on Front End
- “Formats” Select Menu in WP Editor doesn’t show up with correct colour
- WordPress Editor without buttons
- Adding a class to custom TinyMCE button using WPLinks dialog box
- How to remove “justifyfull” in TinyMCE
- wp_editor Too Tall when Content is Loaded
- Inline Editing with wp_editor and tinymce (problem with textarea)
- Adding New Row of Custom TinyMCE
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- Switch between Visual and HTML tab freely
- Removing buttons from the editor
- How i can i add a split button or list box to the WordPress TinyMCE instance
- TinyMCE in customizer
- Markup of oEmbed codes in the editor?
- Detecting when TinyMCE is “ready”
- Second toolbar in tinymce has “display:none” set?
- WP_Editor – Remove TinyMCE Toolbars
- Using post ID in custom tinyMCE button
- onClick inside post_content does not appear in post tinymce editor
- Easy way to inject js in tinymce iframe?
- What is this: data-wplink-url-error=”true” and why is it added to my links?
- Customising the WordPress TinyMce editor and it’s buttons
- Deprecated TinyMCE API call: windowManager.createInstance(..)
- Adding Custom Styles to the MCE dropdown toolbar
- How to add button in TinyMCE TEENY mode?
- Insert dynamic listbox options in Tinymce popup editor
- Can’t remove generated by editor from database
- Custom TinyMCE style formats disabled
- TinyMCE function: Remove (earlier) added style from the editor
- Post content not showing in the edit post textarea
- Disable TinyMCE Table formatting width/height
- Use schema.org HTML in TinyMCE Editor
- Theme option not saved if in wp_editor() and html decoded
- wp_editor in thickbox
- Customer Support: TinyMCE stopped working (on some computers)
- How can I make the page editor trust me?
- Adding custom block formats to TinyMCE. Everything works until JavaScript error when applying the format
- Adding CSS to admin TinyMCE editor for custom button
- How can a TinyMCE modal return formatted/visual text?
- Blank spaces show as a question mark
- Can i set css class for table via TinyMCE [closed]
- Where’s the explanation of the TinyMCE’s vars in the WP core?
- How to edit blockquote image
- Customizing tinyMCE 4 Styles and Format dropdowns
- WordPress (TinyMCE) not removing script tags
- Why Editor reformats my code
- How can I remove using built in wordpress filters
- TinyMCE is inactive after installation
- How to set custom TinyMCE format style as default?
- Did Gutenberg block editor change the html in post content during import?
- Remove distraction free mode from teeny editor
- How to load WP_Editor JS files manually (with AJAX)?
- Prevent Black Studio TinyMCE from adding tags when switching from Visual to HTML mode
- What is zinging my HTML commands? I don’t think I can blame TinyMCE this time…
- wp-editor-area textarea disapear on cancel-comment-reply-link click
- wp_editor() in content that was loaded with ajax [duplicate]
- Is there an alternative way to upload html without using TinyMCE?
- Add new MCE button for toggle specific cell background color
- WordPress Started Executing Code Inside PRE Tags Even They Are Properly Escaped