__
Retrieve the translation of $text.
Description
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
if ( !function_exists( '__' ) ) { require_once ABSPATH . WPINC . '/l10n.php'; } // Text to translate. $text = ''; // Optional. Text domain. Unique identifier for retrieving translated strings. // Default 'default'. $domain = 'default'; // NOTICE! Understand what this does before running. $result = __($text, $domain);
Defined (2)
The function is defined in the following location(s).
- /wp-includes/l10n.php
- function __( $text, $domain = 'default' ) {
- return translate( $text, $domain );
- }
- /wp-admin/includes/noop.php
- function __() {}