Language_Helper::get_researcher_language()publicYoast 1.0

Checks whether we have a specific researcher for the current locale and returns that language. If there is no researcher for the current locale, returns default as the researcher.

Метод класса: Language_Helper{}

Хуков нет.


Строку. The language to use to select a researcher.


$Language_Helper = new Language_Helper();

Код Language_Helper::get_researcher_language() Yoast 21.6

public function get_researcher_language() {
	$researcher_language = WPSEO_Language_Utils::get_language( \get_locale() );
	$supported_languages = Researcher_Languages::SUPPORTED_LANGUAGES;

	if ( ! \in_array( $researcher_language, $supported_languages, true ) ) {
		$researcher_language = 'default';
	return $researcher_language;