esc_attr_e

Display translated text that has been escaped for safe use in an attribute.

Description

esc_attr_e( (string) $text, (string) $domain = 'default' ); 

Parameters (2)

0. $text (string)
Text to translate.
1. $domain — Optional. (string) => 'default'
Text domain. Unique identifier for retrieving translated strings. Default default..

Usage

  1. if ( !function_exists( 'esc_attr_e' ) ) { 
  2. require_once ABSPATH . WPINC . '/l10n.php'; 
  3.  
  4. // Text to translate. 
  5. $text = ''; 
  6.  
  7. // Optional. Text domain. Unique identifier for retrieving translated strings. 
  8. // Default 'default'. 
  9. $domain = 'default'; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = esc_attr_e($text, $domain); 
  13.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/l10n.php  
  1. function esc_attr_e( $text, $domain = 'default' ) { 
  2. echo esc_attr( translate( $text, $domain ) );