WP_Locale_Switcher::filter_locale( string $locale )

Filters the locale of the WordPress installation.


Description Description


Parameters Parameters

$locale

(string) (Required) The locale of the WordPress installation.


Top ↑

Return Return

(string) The locale currently being switched to.


Top ↑

Source Source

File: wp-includes/class-wp-locale-switcher.php

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

		if ( $switched_locale ) {
			return $switched_locale;
		}

		return $locale;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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