pre_determine_locale
Filters the locale for the current request prior to the default determination process.
Using this filter allows to override the default logic, effectively short-circuiting the function.
Usage
add_filter( 'pre_determine_locale', 'wp_kama_pre_determine_locale_filter' );
/**
* Function for `pre_determine_locale` filter-hook.
*
* @param string|null $locale The locale to return and short-circuit.
*
* @return string|null
*/
function wp_kama_pre_determine_locale_filter( $locale ){
// filter...
return $locale;
}
- $locale(string|null)
- The locale to return and short-circuit.
Default: null
Changelog
| Since 5.0.0 | Introduced. |
Where the hook is called
pre_determine_locale
wp-includes/l10n.php 134
$determined_locale = apply_filters( 'pre_determine_locale', null );