Translate string with gettext context, and escapes it for safe use in an attribute.

Signature

esc_attr_x( $text, $context, $domain = 'default' )
text
 (string) Text to translate.
context
 (string) Context information for the translators.
domain
 (string) Optional. Text domain. Unique identifier for retrieving translated strings.
Default: 'default'

Return

(string) Translated text

Source

function esc_attr_x( $text, $context, $domain = 'default' ) {
	return esc_attr( translate_with_gettext_context( $text, $context, $domain ) );
}
WP Trac GitHub

Link here