WordPress at a glance
function is not described

WP_Locale_Switcher::filter_locale() public WP 4.7.0

Filters the locale of the WordPress installation.

{} It's a method of the class: WP_Locale_Switcher{}

No Hooks.

Return

String. The locale currently being switched to.

Usage

$WP_Locale_Switcher = new WP_Locale_Switcher();
$WP_Locale_Switcher->filter_locale( $locale );
$locale(string) (required)
The locale of the WordPress installation.

Changelog

Since 4.7.0 Introduced.

Code of WP_Locale_Switcher::filter_locale() WP 5.5.1

<?php
public function filter_locale( $locale ) {
	$switched_locale = end( $this->locales );

	if ( $switched_locale ) {
		return $switched_locale;
	}

	return $locale;
}