change_locale WordPress Action Hook

The change_locale Wordpress hook enables a plugin to change the current locale. This is useful for creating a multilingual site. The hook is triggered when the user changes the locale in their Wordpress settings.

do_action( 'change_locale', string $locale ) #

Fires when the locale is switched to or restored.


Parameters

$locale

(string)The new locale.


Top ↑

Source

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

View on Trac



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.