WP_Locale_Switcher::__construct() WordPress Method

The WP_Locale_Switcher::__construct() method is used to switch between different locales. This is useful for sites that need to be displayed in multiple languages.

WP_Locale_Switcher::__construct() #

Constructor.


Description

Stores the original locale as well as a list of all available languages.


Top ↑

Source

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

	public function __construct() {
		$this->original_locale     = determine_locale();
		$this->available_languages = array_merge( array( 'en_US' ), get_available_languages() );
	}


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.