On this page
_WP_Editors::get_mce_locale(): string
Returns the TinyMCE locale.
Return
string
Source
File: wp-includes/class-wp-editor.php. View all references
public static function get_mce_locale() {
if ( empty( self::$mce_locale ) ) {
$mce_locale = get_user_locale();
self::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1.
}
return self::$mce_locale;
}
Related
Uses
| Uses | Description |
|---|---|
| get_user_locale() wp-includes/l10n.php | Retrieves the locale of a user. |
Used By
| Used By | Description |
|---|---|
| _WP_Editors::default_settings() wp-includes/class-wp-editor.php | Returns the default TinyMCE settings. |
| _WP_Editors::editor_settings() wp-includes/class-wp-editor.php | |
| _WP_Editors::wp_mce_translation() wp-includes/class-wp-editor.php | Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(), or as JS snippet that should run after tinymce.js is loaded. |
Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/_wp_editors/get_mce_locale