Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: locale

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

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      $locale = apply_filters('locale', $locale);
42
43      return $locale;
44 }
45
46 /**
47  * Retrieve the translated text.
48  *
49  * If the domain is set in the $l10n global, then the text is run through the
50  * domain's translate method. After it is passed to the 'gettext' filter hook,