Sanitize content from wp_editor

In short: it is in dependence of your context, the data inside your editor. wp_kses() is really helpful, and you can define your custom allowed HTML tags. Alternative, you can use the default functions, like wp_kses_post or wp_kses_data. These functions are helpful in ensuring that HTML received from the user only contains white-listed elements. See … Read more

wp_editor textarea value not updating

tinyMCE <textarea> element is initially unseen by the used serialize function: $.post( ajaxurl, $(‘#addtag’).serialize(), function(r) { // Content here. } }); You will need to call tinyMCE.triggerSave() to make it visible. Below is a simple snippet that should do the trick: jQuery(‘#submit’).mousedown( function() { tinyMCE.triggerSave(); }); This in an external file, enqueued with wp_enqueue_script(); it … Read more