What does the WordPress "_e()" function do?

Solution 1:

https://developer.wordpress.org/reference/functions/_e/

In WordPress, strings in the php files are marked for translation to other languages, and localization using two “tags” which are actually functions. They are:

__() _e()

Solution 2:

They are used for localization in WordPress themes. If you're only using one language for your theme, you don't need them.

Solution 3:

It is a WordPress Function used for localization. See the WordPress Docs for localization.

With this function you can output/assign "hardcoded" strings within your theme/plugin/code that are translateable (with .mo / .po files or plugins like WPML String Translation).

The function __( 'My Text', 'my-text-domain' ); assigns a string "My Text" that is translateable. 'my-text-domain' is the text-doamin the string is referenced to. This function does not echo anything!

The function _e( 'My Text', 'my-text-domain' ); is almost the same but it echoes your string directly.

WordPress Offers several other functions for localization, take a look into the Codex (link on top of my answer).

Solution 4:

These are for WordPress localization.

Here is their documentation: http://codex.wordpress.org/Function_Reference/_e

Also a few links on localization in general on WordPress to put the _e's in context:

  • http://make.wordpress.org/docs/plugin-developer-handbook/plugin-components/internationalization/
  • http://codex.wordpress.org/I18n_for_WordPress_Developers