On this page
WP_Locale_Switcher::__construct()
Constructor.
Description
Stores the original locale as well as a list of all available languages.
Source
File: wp-includes/class-wp-locale-switcher.php. View all references
public function __construct() {
$this->original_locale = determine_locale();
$this->available_languages = array_merge( array( 'en_US' ), get_available_languages() );
}
Related
Uses
| Uses | Description |
|---|---|
| determine_locale() wp-includes/l10n.php | Determines the current locale desired for the request. |
| get_available_languages() wp-includes/l10n.php | Gets all available languages based on the presence of *.mo files in a given directory. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_locale_switcher/__construct