Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: gettext

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
22
23      return $locale;
24 }
25
26 // Return a translated string.    
27 function __($text, $domain = 'default') {
28      global $l10n;
29
30      if (isset($l10n[$domain]))
31           return apply_filters('gettext', $l10n[$domain]->translate($text), $text);
32      else
33           return $text;
34 }
35
36 // Echo a translated string.
37 function _e($text, $domain = 'default') {
38      global $l10n;
39
40      if (isset($l10n[$domain]))
41           echo apply_filters('gettext', $l10n[$domain]->translate($text), $text);
42      else
43           echo $text;
44 }
45
46 // Return the plural form.
47 function __ngettext($single, $plural, $number, $domain = 'default') {
48      global $l10n;
49
50      if (isset($l10n[$domain])) {