I was wondering if anybody could provide me a solution for removing keyboard shortcuts from tinyMCE in WordPress 4.0?
As I’m using frontend text editor, I want to disable ALT + SHIFT + M (opens media gallery) and ALT + F (opens full screen and users can’t add brackets opening)
Any help would be appreciated
Here’s an elegant solution (original answer here), just add this to your functions.php file:
And here is a brief description of the functions and filters used.
This filter grants developers access to the TinyMCE settings array,
There we can hook our js function on TinyMCE setup using this:
And finally, this action,
Fires after tinymce.js is loaded, but before any TinyMCE editor instances are created. In here we create our javascript function which will disable editor shortcuts on init by replacing them with no-op functions.
Hope this helps.