WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Deactivating TinyMCE keyboard shortcut (5 posts)

  1. fharper
    Member
    Posted 9 months ago #

    I'm using the latest version of WordPress, and when I try to use ALT + 0 to do a right square bracket (I'm using a French keyboard), I got an accessibility help dialog from TinyMCE. Is there a way to deactivate this dialog, this shortcut or all keyboard shortcuts for TinyMCE?

    I didn't find anything, any idea?

  2. fharper
    Member
    Posted 9 months ago #

    For those who are looking to do the same, you can add this code to functions.php

    //Remove TinyMCE shortcuts
    function myformatTinyMCE($in)
    {
    	$in['custom_shortcuts']=false;
    	return $in;
    }
    add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
  3. slpalfrey
    Member
    Posted 5 months ago #

    I'm also interested in deactivating the ALT+0 since I use ALT for unicode hex character input (all the greek letters start with 0). I tried your code but got the error:

    Fatal error: Call to undefined function add_filter() in /home/.../wp-includes/functions.php on line 354

    I put this code in wp-includes/functions.php. Is this the right place? I see that add_filter API is included in wp-includes/plugin.php but it isn't recognized. Is there something more I have to do?

    Thanks!

  4. Joe Dolson
    Member
    Posted 5 months ago #

    That code should be added to the functions.php you'll find in your theme directory. Not knowing your theme, I can't give you an exact path, but something like /wp-content/themes/your-theme/functions.php

  5. slpalfrey
    Member
    Posted 5 months ago #

    Thank you Joe. That solved my problem.

Reply

You must log in to post.

About this Topic