esc_html_x()WP 2.9.0

Translates string with gettext context, and escapes it for safe use in HTML output.

If there is no translation, or the text domain isn't loaded, the original text is escaped and returned.

Хуков нет.

Возвращает

Строку. Translated text.

Использование

esc_html_x( $text, $context, $domain );
$text(строка) (обязательный)
Text to translate.
$context(строка) (обязательный)
Context information for the translators.
$domain(строка)
Text domain. Unique identifier for retrieving translated strings.
По умолчанию: 'default'

Список изменений

С версии 2.9.0 Введена.

Код esc_html_x() WP 6.5.2

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