do_action( 'switch_locale', string $locale , false|int $user_id )
Fires when the locale is switched.
Parameters
-
$locale
string -
The new locale.
-
$user_id
false|int -
User ID for context if available.
Source
File: wp-includes/class-wp-locale-switcher.php
.
View all references
do_action( 'switch_locale', $locale, $user_id );
Changelog
Version | Description |
---|---|
6.2.0 | The $user_id parameter was added. |
4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Basic example of the hook for below operations.