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 |
|---|---|
| 28 | |
| 29 | if ( isset( $locale ) ) |
| 30 | /** |
| 31 | * Filter WordPress install's locale ID. |
| 32 | * |
| 33 | * @since 1.5.0 |
| 34 | * |
| 35 | * @param string $locale The locale ID. |
| 36 | */ |
| 37 | return apply_filters( 'locale', $locale ); |
| 38 | |
| 39 | // WPLANG is defined in wp-config. |
| 40 | if ( defined( 'WPLANG' ) ) |
| 41 | $locale = WPLANG; |
| 42 | |
| 43 | // If multisite, check options. |
| 44 | if ( is_multisite() ) { |
| 45 | // Don't check blog option when installing. |
| 46 | if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) ) |
| Line | Code |
| 48 | |
| 49 | if ( $ms_locale !== false ) |
| 50 | $locale = $ms_locale; |
| 51 | } |
| 52 | |
| 53 | if ( empty( $locale ) ) |
| 54 | $locale = 'en_US'; |
| 55 | |
| 56 | // duplicate_hook |
| 57 | return apply_filters( 'locale', $locale ); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Retrieve the translation of $text. |
| 62 | * |
| 63 | * If there is no translation, or the text domain isn't loaded, the original text is returned. |
| 64 | * |
| 65 | * <strong>Note:</strong> Don't use translate() directly, use __() or related functions. |
| 66 | * |