apply_filters( 'locale', string $locale )
Filters the locale ID of the WordPress installation.
Parameters Parameters
- $locale
-
(string) The locale ID.
Source Source
File: wp-includes/l10n.php
Changelog Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
User Contributed Notes User Contributed Notes
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.
Expand full source codeCollapse full source code
Example migrated from Codex:
An example of changing the locale language based on the $_GET parameter of the URL.
Expand full source codeCollapse full source code