WordPress _e() function - support multi languages

I like to keep WordPress templates as simple as possible. While cleaning up some common templates, I found these functions _e() and __() are being used quite a lot.

I did a simple search and found out that they are designed for multi-language support.

Strings from WordPress templates can be translated to other languages when they are parameters of the localization functions _e() or __().


The difference of these two functions are that the function _e() echoes the string and the function __() returns the string.

Using the “GNU gettext” framework, it searches the localization module and returns translation of the argument, in this example “Categories” when it’s found. When no translation is found, it returns the original argument.

No Comments

Leave a comment