WP_Locale_Switcher::filter_locale

Advertisement

Summery Summery

Filters the locale of the WordPress installation.

Syntax Syntax

WP_Locale_Switcher::filter_locale( string $locale )

Parameters Parameters

$locale

(Required) The locale of the WordPress installation.

Return Return

(string) The locale currently being switched to.

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

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply