_WP_Editors::get_mce_locale() WordPress Method

The WP_Editors::get_mce_locale() method is used to get the localization for the WordPress TinyMCE editor. This is useful for plugin and theme developers who need to internationalize their code.

_WP_Editors::get_mce_locale() #

Returns the TinyMCE locale.


Return

(string)


Top ↑

Source

File: wp-includes/class-wp-editor.php

	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;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.