switch_locale WordPress Action Hook

The switch_locale Wordpress hook is used to change the locale of a Wordpress site. This can be useful for changing the language of a site, or for creating a multilingual site.

do_action( 'switch_locale', string $locale ) #

Fires when the locale is switched.


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.