mce_external_languages
Filters the translations loaded for external TinyMCE 3.x plugins.
The filter takes an associative array ('plugin_name' => 'path') where 'path' is the include path to the file.
The language file should follow the same format as wp_mce_translation(), and should define a variable ($strings) that holds all translated strings.
Usage
add_filter( 'mce_external_languages', 'wp_kama_mce_external_languages_filter', 10, 2 ); /** * Function for `mce_external_languages` filter-hook. * * @param array $translations Translations for external TinyMCE plugins. * @param string $editor_id Unique editor identifier, e.g. 'content'. * * @return array */ function wp_kama_mce_external_languages_filter( $translations, $editor_id ){ // filter... return $translations; }
- $translations(array)
- Translations for external TinyMCE plugins.
- $editor_id(string)
- Unique editor identifier, e.g. 'content'.
Changelog
Since 2.5.0 | Introduced. |
Since 5.3.0 | The $editor_id parameter was added. |
Where the hook is called
mce_external_languages
wp-includes/class-wp-editor.php 487
$mce_external_languages = apply_filters( 'mce_external_languages', array(), $editor_id );