W3cubDocs

/WordPress

WP_Locale_Switcher::init()

Initializes the locale switcher.

Description

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

Source

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

Changelog

Version Description
4.7.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_locale_switcher/init