‘Add Media’ button doesn’t work when editor is initialized from javascript
The solution was to call wp_enqueue_media() along with wp_enqueue_editor().
The solution was to call wp_enqueue_media() along with wp_enqueue_editor().
Make sure you’ve registered the stylesheet for the editor: add_editor_style( ‘http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css’ ); This should be in your functions.php https://codex.wordpress.org/Editor_Style
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
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