WP_Locale_Switcher::is_switched()publicWP 4.7.0

Whether switch_to_locale() is in effect.

Method of the class: WP_Locale_Switcher{}

No Hooks.

Return

true|false. True if the locale has been switched, false otherwise.

Usage

$WP_Locale_Switcher = new WP_Locale_Switcher();
$WP_Locale_Switcher->is_switched();

Changelog

Since 4.7.0 Introduced.

WP_Locale_Switcher::is_switched() code WP 6.5.2

public function is_switched() {
	return ! empty( $this->stack );
}