WP_Locale_Switcher::is_switched() WordPress Method
The WP_Locale_Switcher::is_switched() function allows you to check if the locale has been switched for the current request. This can be useful for conditionally loading language-specific resources.
WP_Locale_Switcher::is_switched() #
Whether switch_to_locale() is in effect.
Return
(bool) True if the locale has been switched, false otherwise.
Source
File: wp-includes/class-wp-locale-switcher.php
public function is_switched() { return ! empty( $this->locales ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |