WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 26 | * @global string $wp_local_package Locale code of the package. |
| 27 | * |
| 28 | * @return string The locale of the blog or from the {@see 'locale'} hook. |
| 29 | */ |
| 30 | function get_locale() { |
| 31 | global $locale, $wp_local_package; |
| 32 | |
| 33 | if ( isset( $locale ) ) { |
| 34 | /** This filter is documented in wp-includes/l10n.php */ |
| 35 | return apply_filters( 'locale', $locale ); |
| 36 | } |
| 37 | |
| 38 | if ( isset( $wp_local_package ) ) { |
| 39 | $locale = $wp_local_package; |
| 40 | } |
| 41 | |
| 42 | // WPLANG was defined in wp-config. |
| 43 | if ( defined( 'WPLANG' ) ) { |
| 44 | $locale = WPLANG; |
| Line | Code |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Filters the locale ID of the WordPress installation. |
| 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 | * |
| 86 | * If the user has a locale set to a non-empty string then it will be |
| 87 | * returned. Otherwise it returns the locale of get_locale(). |
| 88 | * |
| 89 | * @since 4.7.0 |