WP_Locale_Switcher::filter_locale( string $locale )
Filters the locale of the WordPress installation.
Parameters
- $locale
-
(string) (Required) The locale of the WordPress installation.
Return
(string) The locale currently being switched to.
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; }
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_locale_switcher/filter_locale