pre_determine_locale
Filter HookDescription
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.Hook Information
File Location |
wp-includes/l10n.php
View on GitHub
|
Hook Type | Filter |
Line Number | 134 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|null
|
$locale
|
The locale to return and short-circuit. Default null. |
Usage Examples
Basic Usage
<?php
// Hook into pre_determine_locale
add_filter('pre_determine_locale', 'my_custom_filter', 10, 1);
function my_custom_filter($locale) {
// Your custom filtering logic here
return $locale;
}
Source Code Context
wp-includes/l10n.php:134
- How this hook is used in WordPress core
<?php
129 *
130 * @since 5.0.0
131 *
132 * @param string|null $locale The locale to return and short-circuit. Default null.
133 */
134 $determined_locale = apply_filters( 'pre_determine_locale', null );
135
136 if ( $determined_locale && is_string( $determined_locale ) ) {
137 return $determined_locale;
138 }
139
PHP Documentation
<?php
/**
* 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.
*
* @since 5.0.0
*
* @param string|null $locale The locale to return and short-circuit. Default null.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/l10n.php
Related Hooks
Related hooks will be displayed here in future updates.