Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren

esc_attr__ ›

esc_attr__ ( $text, $domain = 'default' )
Parameter: (2)
  • (string) $text Text to translate.
    Erforderlich: Ja
  • (string) $domain Optional. Text domain. Unique identifier for retrieving translated strings. Default 'default'.
    Erforderlich: Nein
    Standard: 'default'
Gibt zurück:
  • (string) Translated text on success, original text on failure.
Definiert in:

Retrieve the translation of $text and escapes it for safe use in an attribute.

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


function esc_attr__( $text, $domain = 'default' ) {
	return esc_attr( translate( $text, $domain ) );