mce_external_languages
最后更新于:2021-11-27 07:12:18
apply_filters( ‘mce_external_languages’, array $translations, string $editor_id )
Filters the translations loaded for external TinyMCE 3.x plugins.
参数
- $translations
-
(array)
Translations for external TinyMCE plugins. - $editor_id
-
(string)
Unique editor identifier, e.g. ‘content’.
源文件
文件: gc-includes/class-gc-editor.php
// This file is based on gc-includes/js/tinymce/langs/gc-langs.php if ( ! defined( 'ABSPATH' ) ) exit; if ( ! class_exists( '_GC_Editors' ) ) require( ABSPATH . GCINC . '/class-gc-editor.php' ); function my_custom_tinymce_plugin_translation() { $strings = array( 'somestring' => __('My custom Tinymce plugin', 'textdomain'), ); $locale = _GC_Editors::$mce_locale; $translated = 'tinyMCE.addI18n("' . $locale . '.my_custom_tinymce_plugin", ' . json_encode( $strings ) . ");n"; return $translated; } $strings = my_custom_tinymce_plugin_translation();