Yoast\WP\SEO\Helpers

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();

Код Language_Helper::get_researcher_language() Yoast 19.11

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