__

Retrieve the translation of $text.

Description

(string) __( (string) $text, (string) $domain = 'default' ); 

If there is no translation, or the text domain isn't loaded, the original text is returned.

Returns (string)

Translated text.

Parameters (2)

0. $text (string)
Text to translate.
1. $domain — Optional. (string) => 'default'
Text domain. Unique identifier for retrieving translated strings. Default default..

Usage

  1. if ( !function_exists( '__' ) ) { 
  2. require_once ABSPATH . WPINC . '/l10n.php'; 
  3.  
  4. // Text to translate. 
  5. $text = ''; 
  6.  
  7. // Optional. Text domain. Unique identifier for retrieving translated strings. 
  8. // Default 'default'. 
  9. $domain = 'default'; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = __($text, $domain); 
  13.  

Defined (2)

The function is defined in the following location(s).

/wp-includes/l10n.php  
  1. function __( $text, $domain = 'default' ) { 
  2. return translate( $text, $domain ); 
/wp-admin/includes/noop.php  
  1. function __() {}