Yoast_I18n_v3::get_admin_locale()privateYoast 1.0

Returns the locale used in the admin.

WordPress 4.7 introduced the ability for users to specify an Admin language different from the language used on the front end. This checks if the feature is available and returns the user's language, with a fallback to the site's language. Can be removed when support for WordPress 4.6 will be dropped, in favor of WordPress get_user_locale() that already fallbacks to the site’s locale.

{} Это метод класса: Yoast_I18n_v3{}

Хуков нет.


null. Ничего.


// private - только в коде основоного (родительского) класса
$result = $this->get_admin_locale();

Код Yoast_I18n_v3::get_admin_locale() Yoast 19.7.1

private function get_admin_locale() {
	if ( function_exists( 'get_user_locale' ) ) {
		return get_user_locale();

	return get_locale();