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 |
|---|---|
| 23 | * @uses apply_filters() Calls 'locale' hook on locale value. |
| 24 | * @uses $locale Gets the locale stored in the global. |
| 25 | * |
| 26 | * @return string The locale of the blog or from the 'locale' hook. |
| 27 | */ |
| 28 | function get_locale() { |
| 29 | global $locale; |
| 30 | |
| 31 | if (isset($locale)) |
| 32 | return apply_filters( 'locale', $locale ); |
| 33 | |
| 34 | // WPLANG is defined in wp-config. |
| 35 | if (defined('WPLANG')) |
| 36 | $locale = WPLANG; |
| 37 | |
| 38 | if (empty($locale)) |
| 39 | $locale = 'en_US'; |
| 40 | |
| 41 | return apply_filters('locale', $locale); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Retrieves the translation of $text. If there is no translation, or |
| 46 | * the domain isn't loaded the original text is returned. |
| 47 | * |
| 48 | * @see __() Don't use translate() directly, use __() |
| 49 | * @since 2.2.0 |
| 50 | * @uses apply_filters() Calls 'gettext' on domain translated text |