WP_Locale_Switcher::init()publicWP 4.7.0

Initializes the locale switcher.

Hooks into the locale and determine_locale filters to change the locale on the fly.

Method of the class: WP_Locale_Switcher{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Changelog

Since 4.7.0 Introduced.

WP_Locale_Switcher::init() code WP 6.5.2

public function init() {
	add_filter( 'locale', array( $this, 'filter_locale' ) );
	add_filter( 'determine_locale', array( $this, 'filter_locale' ) );
}