WP_Locale_Switcher::filter_locale( string $locale ): string

In this article

Filters the locale of the WordPress installation.

Parameters

$localestringrequired
The locale of the WordPress installation.

Return

string The locale currently being switched to.

Source

public function filter_locale( $locale ) {
	$switched_locale = $this->get_switched_locale();

	if ( $switched_locale ) {
		return $switched_locale;
	}

	return $locale;
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.