theme_locale
Filters a theme's locale.
Usage
add_filter( 'theme_locale', 'wp_kama_theme_locale_filter', 10, 2 ); /** * Function for `theme_locale` filter-hook. * * @param string $locale The theme's current locale. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * * @return string */ function wp_kama_theme_locale_filter( $locale, $domain ){ // filter... return $locale; }
- $locale(string)
- The theme's current locale.
- $domain(string)
- Text domain. Unique identifier for retrieving translated strings.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
theme_locale
wp-includes/l10n.php 1105
$locale = apply_filters( 'theme_locale', determine_locale(), $domain );