TinyMCE Shortcode button fix
-
Hi,
I fixed the issue with the shortcode button in the visual editor for newer wordpress versions. I hope Will Zachmann could implement it in the next version 🙂
There are other issues that come with the visual editor (TinyMCE) because the functions get updated sooner or later and break older plugins. I just focused on the issue with the shortcode insert button.
Open the shortcode-exec-php-class.php in the plugin-folder and scroll to this js-part (about line 1189):
$('#scep-tinymce-form').submit(function() { if (window.tinyMCE) { window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, '[' + $('#scep-tinymce-shortcode').val() + ']'); tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.close(); } return false; });Change it this way and save it:
$('#scep-tinymce-form').submit(function() { if (window.tinyMCE) { if (tinyMCE.majorVersion>="4") { window.tinyMCE.execCommand('mceInsertContent', false, '[' + $('#scep-tinymce-shortcode').val() + ']'); } else { window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, '[' + $('#scep-tinymce-shortcode').val() + ']'); } tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.close(); } return false; });That’s all 😉
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘TinyMCE Shortcode button fix’ is closed to new replies.