Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_x ›

Seit2.8.0
Veraltetn/v
_x ( $text, $context, $domain = 'default' )
Parameter: (3)
  • (string) $text Text to translate.
    Erforderlich: Ja
  • (string) $context Context information for the translators.
    Erforderlich: Ja
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.
    Erforderlich: Nein
    Standard: 'default'
Gibt zurück:
  • (string) Translated context string without pipe.
Definiert in:
Codex:

Retrieve translated string with gettext context.

Quite a few times, there will be collisions with similar translatable text found in more than two places, but with different translated context.

By including the context in the pot file, translators can translate the two strings differently.



Ähnliche Funktionen: _nx, _ex, _, is_tax, __

Quellcode

function _x( $text, $context, $domain = 'default' ) {
	return translate_with_gettext_context( $text, $context, $domain );
}