• Defined in wp-l10n.php

    // Return a translated string.
    function __($text, $domain = ‘default’) {
    global $l10n;

    if (isset($l10n[$domain])) {
    return $l10n[$domain]->translate($text);
    } else {
    return $text;
    }
    }

    // Echo a translated string.
    function _e($text, $domain = ‘default’) {
    global $l10n;

    if (isset($l10n[$domain])) {
    echo $l10n[$domain]->translate($text);
    } else {
    echo $text;
    }
    }

    Used all over the place in the WordPress code…. but what purpose do they serve exactly?

    Thanks for any help! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘function _e and __’ is closed to new replies.