Filters the locale ID of the WordPress installation.
Parameters
$locale
string- The locale ID.
Source
return apply_filters( 'locale', $locale );
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
Filters the locale ID of the WordPress installation.
$locale
stringreturn apply_filters( 'locale', $locale );
Version | Description |
---|---|
1.5.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
You can leverage this hook to force the language of your admin dashboard, however, you need to call it from a plugin and not from your theme, by the time WordPress gets to loading your theme it’s too late.
Example migrated from Codex:
An example of changing the locale language based on the $_GET parameter of the URL.