Theme option not saved if in wp_editor() and html decoded
Theme option not saved if in wp_editor() and html decoded
Theme option not saved if in wp_editor() and html decoded
Default Link for TinyMCE “Add Link”
How to prevent shortcode preview from breaking in tinymce editor?
Change syntax styling of TinyMCE HTML Text Editor
Adding a colorbutton in tinymce dialog with current api
TinyMCE style formats for different post types
Assuming your TinyMCE4 container has an id of ‘tiny-mce-4’, you could add this js to your functions.php. function toArray (collection) { return Array.prototype.slice.call(collection); } var imgs = toArray(document.querySelectorAll(‘#tiny-mce-4 img’)); imgs.forEach(function(img){ img.setAttribute(‘style’, img.getAttribute(‘style’).replace(/((height:).*?(px;))/g, ‘max-width: 100%;’)); }); <div id=”tiny-mce-4″> <img src=”https://wordpress.stackexchange.com/questions/207673/img1″ style=”height: 500px; width: 800px;” /> <img src=”img2″ style=”height: 500px; width: 800px;” /> <img src=”img3″ style=”height: 500px; … Read more
You are in luck. There is a WordPress internal function for that. It’s the wp_editor function. The function does all the work for you. It enqueues the right scripts and style-sheets. Just pass the configuration you want. wp_editor(‘Enter your text here’, ‘editor_id_here’)
I dug this solution up, which adds meta to valid_children (untested): // Prevent TinyMCE from stripping out schema.org metadata // https://snipt.net/jamesw/prevent-tinymce-from-stripping-schemaorg-attributes-in-wordpress/ function schema_TinyMCE_init( $in ) { /** * Edit extended_valid_elements as needed. For syntax, see * http://www.tinymce.com/wiki.php/Configuration:valid_elements * * NOTE: Adding an element to extended_valid_elements will cause TinyMCE to ignore * default attributes for that … Read more
How to reference TinyMCE body in my script