_ex()
Displays translated text (string) with specified context.
This function simply displays what _x() retrieve. For more detailed information about context translation, see the description of _x().
Uses: _x()
1 time — 0.00004 sec (very fast) | 50000 times — 0.14 sec (very fast) | PHP 7.1.2, WP 4.7.3
No Hooks.
Return
null
. Nothing (null). Displays translated text or original text if the string could not be translated.
Usage
<?php _ex( $text, $context, $domain ); ?>
- $text(string) (required)
- Text to translate.
- $context(string) (required)
- Context information for the translators.
- $domain(string)
- Text domain. Unique identifier for retrieving translated strings.
Default: 'default'
Examples
#1 Display the translated string in the specified context
Here translates the string Format in the context of post format.
<?php _ex( 'Format', 'post format', 'text_domain' ); ?>
Now, for example, if we translate to Russian, this code will display the translation of Format
> Формат
.
Changelog
Since 3.0.0 | Introduced. |
_ex() ex code WP 6.6.1
function _ex( $text, $context, $domain = 'default' ) { echo _x( $text, $context, $domain ); }