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
- wp_editor mce-view
- How to add placeholder in wp_editor?
- How do I include a TinyMCE editor in the frontend?
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- Switch between Visual and HTML tab freely
- How to load wp_editor via AJAX
- How to add custom CSS (theme option) to TinyMCE?
- How to add “Insert/Edit link” button in custom popup tinymce window?
- How to disable TinyMCE from removing span tags
- WordPress automatically adding ” “?
- Add popup window to TinyMCE buttons
- How to customize TinyMCE4 in WP 3.9 – the old way for styles and formats doesn’t work anymore
- TinyMCE editor is breaking my beautiful HTML
- Removing buttons from the editor
- Enqueue Script After TinyMCE initialized
- How to use tinyMCE for user “biographical info”?
- Why did multiple line breaks stop working in text editor?
- Stop editor from removing tags and replacing them with nbsp
- Replace Taxomony Description Field with Visual/WYSIWYG Editor
- How to replace the content of tinyMCE editor in both text and visual mode using jQuery?
- Unable to add “code” button to TinyMCE toolbar
- TinyMCE format dropdown no longer showing style previews
- How i can i add a split button or list box to the WordPress TinyMCE instance
- TinyMCE in customizer
- Possible to stop WordPress from adding p1, p2… classes to p tags in TinyMCE?
- Custom Tiny MCE button to bring up a custom php popup
- WordPress 3.2 has broken my TinyMCE code
- wp_editor disable after reaching character count limit
- When switching from html to visual editor the tag gets corrupted
- Is it possible to re-use the image details popup?
- Markup of oEmbed codes in the editor?
- Visual Tab Missing From Editor
- Is it possible to create nested lists in the WYSIWYG editor?
- How can I stop TinyMCE from converting my HTML entities to characters?
- Add a button to tinyMCE editor on Custom Post Type
- How to keep non-breaking spaces in the visual editor?
- Is there a way to prevent the Editor from modifying my HTML
- Cite-Tag for blockquotes
- Load tinyMCE / wp_editor() via AJAX [duplicate]
- Wait for Gutenberg or built something in ACF?
- Detect a focus on wp_editor
- Replicating the_editor (Media Bar, TinyMCE, Visual/HTML Tabs) functionality without a huge rewrite
- HTML5, WordPress and Tiny MCE issue – wrapping anchor tag around div results in funky output
- Remove “Are You Sure” dialogue when leaving editor
- Creating a custom MCE view for your shortcodes [closed]
- Detecting when TinyMCE is “ready”
- Using a dashicon for a custom button in TinyMCE?
- Apply custom style to single word in WordPress
- How to disable TinyMCE 4 keyboard shortcuts
- How to customize the symbols that appear in the Visual Editor insert custom character
- Pasting code into pre-formatted text in Visual Editor not working in 3.3.1