_e( string $text, string $domain = ‘default’ )

Displays translated text.

Parameters

$textstringrequired
Text to translate.
$domainstringoptional
Text domain. Unique identifier for retrieving translated strings.
Default 'default'.

Default:'default'

Source

function _e( $text, $domain = 'default' ) {
	echo translate( $text, $domain );
}

Changelog

VersionDescription
1.2.0Introduced.

User Contributed Notes

  1. Skip to note 9 content
    _e( string $text, string $domain = 'default' )

    In this function,the “$domain” is used to locate the multilingual file.(The file which is the translation of your theme.)
    In wp-include there is a function related to this var

    function load_theme_textdomain( $domain, $path = false ) {
    $locale = apply_filters( 'theme_locale', get_locale(), $domain );
     
    if ( ! $path )
    $path = get_template_directory();
     
    // Load the textdomain from the Theme provided location, or theme directory first
    $mofile = "{$path}/{$locale}.mo";
    if ( $loaded = load_textdomain($domain, $mofile) )
    return $loaded;
     
    // Else, load textdomain from the Language directory
    $mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo";
    return load_textdomain($domain, $mofile);
    }

    You can see $domain is used in this file.Actually it’s used to locate the .mo file.So you must may sure it share the same name with your theme folder name

  2. Skip to note 11 content

    Important security note: _e() is not an escaping function. Since all output really needs to be escaped, consider using __() instead.

    For example, this is safe:
    echo esc_html( __( 'This is my translatable text' ) )

    But this might not be, because the output can get filtered and is not escaped close to where it is output:
    _e( 'This is my translatable text' )

You must log in before being able to contribute a note or feedback.