WordPress.org

Make WordPress Core

Changeset 24745


Ignore:
Timestamp:
07/18/2013 10:44:40 PM (5 years ago)
Author:
nacin
Message:

Remove the Spellchecker button from TinyMCE.

It appears Google has finally shut off the old private API it used. Spellcheckers built-in to browsers (and operating systems) seem to be the best alternative.

A WordPress plugin could still re-enable this TinyMCE plugin if they wanted.

props ryanduff for initial patch.
fixes #24789.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-editor.php

    r24735 r24745  
    193193                self::$mce_locale = $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
    194194                $no_captions = (bool) apply_filters( 'disable_captions', '' );
    195                 $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
     195                $plugins = array( 'inlinepopups', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
    196196                $first_run = true;
    197197                $ext_plugins = '';
     
    286286                self::$ext_plugins = $ext_plugins;
    287287
    288                 /*
    289                 translators: These languages show up in the spellchecker drop-down menu, in the order specified, and with the first
    290                 language listed being the default language. They must be comma-separated and take the format of name=code, where name
    291                 is the language name (which you may internationalize), and code is a valid ISO 639 language code. Please test the
    292                 spellchecker with your values.
    293                 */
    294                 $mce_spellchecker_languages = __( 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv' );
    295 
    296                 /*
    297                 The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
    298                 By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
    299                 The + sign marks the default language. More: http://www.tinymce.com/wiki.php/Plugin:spellchecker.
    300                 */
    301                 $mce_spellchecker_languages = apply_filters( 'mce_spellchecker_languages', '+' . $mce_spellchecker_languages );
     288                if ( in_array( 'spellchecker', $plugins ) ) {
     289                    /*
     290                    translators: These languages show up in the spellchecker drop-down menu, in the order specified, and with the first
     291                    language listed being the default language. They must be comma-separated and take the format of name=code, where name
     292                    is the language name (which you may internationalize), and code is a valid ISO 639 language code. Please test the
     293                    spellchecker with your values.
     294                    */
     295                    $mce_spellchecker_languages = __( 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv' );
     296
     297                    /*
     298                    The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
     299                    By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
     300                    The + sign marks the default language. More: http://www.tinymce.com/wiki.php/Plugin:spellchecker.
     301                    */
     302                    $mce_spellchecker_languages = apply_filters( 'mce_spellchecker_languages', '+' . $mce_spellchecker_languages );
     303                }
    302304
    303305                self::$first_init = array(
     
    307309                    'skin' => 'wp_theme',
    308310                    'language' => self::$mce_locale,
    309                     'spellchecker_languages' => $mce_spellchecker_languages,
    310311                    'theme_advanced_toolbar_location' => 'top',
    311312                    'theme_advanced_toolbar_align' => 'left',
     
    345346                    'webkit_fake_resize' => false,
    346347                    'preview_styles' => 'font-family font-weight text-decoration text-transform',
    347                     'spellchecker_rpc_url' => self::$baseurl . '/plugins/spellchecker/rpc.php',
    348348                    'schema' => 'html5',
    349349                    'wpeditimage_disable_captions' => $no_captions,
     
    351351                    'plugins' => implode( ',', $plugins )
    352352                );
     353
     354                if ( in_array( 'spellchecker', $plugins ) ) {
     355                    self::$first_init['spellchecker_rpc_url'] = self::$baseurl . '/plugins/spellchecker/rpc.php';
     356                    self::$first_init['spellchecker_languages'] = $mce_spellchecker_languages;
     357                }
    353358
    354359                // load editor_style.css if the current theme supports it
Note: See TracChangeset for help on using the changeset viewer.