locale
Filter HookDescription
Filters the locale ID of the WordPress installation.Hook Information
File Location |
wp-includes/l10n.php
View on GitHub
|
Hook Type | Filter |
Line Number | 80 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$locale
|
The locale ID. |
Usage Examples
Basic Usage
<?php
// Hook into locale
add_filter('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:80
- How this hook is used in WordPress core
<?php
75 *
76 * @since 1.5.0
77 *
78 * @param string $locale The locale ID.
79 */
80 return apply_filters( 'locale', $locale );
81 }
82
83 /**
84 * Retrieves the locale of a user.
85 *
PHP Documentation
<?php
/**
* Filters the locale ID of the WordPress installation.
*
* @since 1.5.0
*
* @param string $locale The locale ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/l10n.php
Related Hooks
Related hooks will be displayed here in future updates.