WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/esc html x

Description

Retrieves the translation of $text in a gettext context, and escapes it for safe use in HTML. If there is no translation, or the domain isn't loaded, the escaped original text is returned.

Usage

<?php esc_html_x$text$context$domain ?>

Parameters

$text
(string) (required) Text to translate.
Default: None
$context
(string) (required) Context information for the translators.
Default: None
$domain
(string) (optional) Domain to retrieve the translated text.
Default: 'default'

Return Values

(string) 
Translated and escaped text, defaulting to escaped original text.

Change Log

Source File

esc_html_x() is located in wp-includes/l10n.php.

Related

L10n: translate(), __(), _e(), _n(), _x(), _ex(), _nx(), esc_attr__(), esc_attr_e(), esc_attr_x(), esc_html__(), esc_html_e(), esc_html_x(), _n_noop(), _nx_noop(), translate_nooped_plural()

See also index of Function Reference and index of Template Tags.