WPSEO_Language_Utils::get_site_language_name()public staticYoast 1.0

Returns the full name for the sites' language.

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

Хуков нет.

Возвращает

Строку. The language name.

Использование

$result = WPSEO_Language_Utils::get_site_language_name();

Код WPSEO_Language_Utils::get_site_language_name() Yoast 19.7.1

public static function get_site_language_name() {
	require_once ABSPATH . 'wp-admin/includes/translation-install.php';

	$translations = wp_get_available_translations();
	$locale       = get_locale();
	$language     = isset( $translations[ $locale ] ) ? $translations[ $locale ]['native_name'] : 'English (US)';

	return $language;
}