wppaste
WordPress

_x( string $text, string $context, string $domain = 'default' ): string

Since
2.8.0
Source
wp-includes/l10n.php:409
Retrieves translated string with gettext context.

Description

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.

Parameters

$textstring
Text to translate.
$contextstring
Context information for the translators.
$domainstringoptional
Text domain. Unique identifier for retrieving translated strings. Default 'default'.Default: 'default'

Return

string
Translated context string without pipe.

Uses · 1

Used by · 50

Show all 50

Source

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

History

Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/l10n.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.