_x

Advertisement

Summery Summery

Retrieve translated string with gettext context.

Syntax Syntax

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

Description 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 Parameters

$text

(Required) Text to translate.

$context

(Required) Context information for the translators.

$domain

(Optional) Text domain. Unique identifier for retrieving translated strings. Default 'default'.

Default value: 'default'

Return Return

(string) Translated context string without pipe.

Source Source

File: wp-includes/l10n.php

/**
 * Display translated text that has been escaped for safe use in HTML output.
 *

Advertisement

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

Advertisement

Leave a Reply