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.


Top ↑

Source

File: wp-includes/class-wp-locale-switcher.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.