WordPress.org

Ready to get started?Download WordPress

Forums

__(), _e() and _x()...what's the difference. Are there more? (2 posts)

  1. JsonB123
    Member
    Posted 4 years ago #

    I think I have the answer for the first two:
    __() and _e() are functionally the same; they translate whatever text is in the parentheses. __() returns the translated text, whereas _e() echoes the translated text out.

    What does _x() do? Are there more? I think I saw someone reference _c() but I haven't seen it used anywhere yet.

    Thanks for the help!

  2. MathSmath
    Member
    Posted 4 years ago #

    http://phpdoc.wordpress.org/trunk/WordPress/i18n/_wp-includes---l10n.php.html#function_x

    Looks like the only special thing about _x() is that it lets you provide a context for the untranslated string--I guess in circumstances where a word might translate differently in different contexts.

Topic Closed

This topic has been closed to new replies.

About this Topic