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 |
|---|---|
| 25 | * @uses apply_filters() Calls 'locale' hook on locale value |
| 26 | * @uses $locale Gets the locale stored in the global |
| 27 | * |
| 28 | * @return string The locale of the blog or from the 'locale' hook |
| 29 | */ |
| 30 | function get_locale() { |
| 31 | global $locale; |
| 32 | |
| 33 | if (isset($locale)) |
| 34 | return apply_filters( 'locale', $locale ); |
| 35 | |
| 36 | // WPLANG is defined in wp-config. |
| 37 | if (defined('WPLANG')) |
| 38 | $locale = WPLANG; |
| 39 | |
| 40 | if (empty($locale)) |
| 41 | $locale = 'en_US'; |
| 42 | |
| 43 | $locale = apply_filters('locale', $locale); |
| 44 | |
| 45 | return $locale; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * translate() - Retrieve the translated text |
| 50 | * |
| 51 | * If the domain is set in the $l10n global, then the text is run |
| 52 | * through the domain's translate method. After it is passed to |