Get the input content of TinyMCE editor

Get the input content of TinyMCE editor

I am recently working on a project that enables users to submit content from frontend.
Since I am using wp_editor() to display the editor, I find it a little bit of confused how to correctly save the input content.

StackExchange user Sam posted a solution in a thread. It just works perfect.

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.

Remember to replace the editor_id with your true editor ID parameter defined in wp_editor().


Author: Leo

My name is Leo who's behind this blog. I've been working with wordpress since 2010. I'll write about themes, plugins, tutorials and all about wordpress here. Hope you find it useful!

Leave a Reply

Your email address will not be published. Required fields are marked *