WP_Locale_Switcher::init() WordPress Method
The WP_Locale_Switcher::init() method is used to initialize the locale switcher for a WordPress site. This is done by setting up the locale and loading the appropriate translation files.
WP_Locale_Switcher::init() #
Initializes the locale switcher.
Description
Hooks into the ‘locale’ filter to change the locale on the fly.
Source
File: wp-includes/class-wp-locale-switcher.php
public function init() { add_filter( 'locale', array( $this, 'filter_locale' ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |