Sanitize AROUND shortcode

Try to use this instead: editor.focus(); var selected_text = editor.selection.getContent(); shortcode=”[checklist-box title=”” + e.data.title + ‘”]’ + selected_text + ‘[/checklist-box]’; editor.selection.setContent(shortcode); editor.setContent(editor.getContent()); Basically, I’m first forcing editor focus and then use setContent instead to change the content. In my tests there were still some glitches on the editor but the source was ok, so I … Read more

WordPress Editor without buttons

I fixed it by adding the following script after making the Ajax call: tinymce.execCommand(‘mceRemoveEditor’, false, ‘customEditor’); tinymce.execCommand(‘mceAddEditor’, false, ‘customEditor’);

Preserve indentation, HTML5 shorthand in editor

Sounds like you are using the wrong software 😉 wordpress is not really designed nor should it be used as an html editor. If for whatever reason you need some concrete HTML format you should either use a shortcode to generate it or create a page template to be used in the places where it … Read more

Changing code with ( ) when author updates their post (TinyMCE)

Technically, this is an issue with TinyMCE, not with WordPress, but WP does provide a gateway to TinyMCE, which allows you to change settings. Your solution might look something like this: add_filter (‘tiny_mce_before_init’, ‘wpse303889_tiny_filter’); function wpse303889_tiny_filter ($in) { $in[‘entity_encoding’] = ‘raw’; return $in; } Setting the entity_encoding filter to ‘raw’ supposedly allows you to get … Read more