esc_html

Escaping for HTML blocks.

Description

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

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

Returns (string)

Translated text

Parameters (2)

0. $text (string)
Text to translate
1. $domain — Optional. (string) => 'default'
Domain to retrieve the translated text

Usage

  1. if ( !function_exists( 'esc_html__' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php'; 
  3.  
  4. // Text to translate 
  5. $text = ''; 
  6.  
  7. // Optional. Domain to retrieve the translated text 
  8. $domain = 'default'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = esc_html__($text, $domain); 
  12.  

Defined (2)

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

/bp-forums/bbpress/bb-includes/functions.bb-l10n.php  
  1. function esc_html__( $text, $domain = 'default' ) { 
  2. return esc_html( translate( $text, $domain ) ); 
/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php  
  1. function esc_html( $text ) { 
  2. $safe_text = wp_check_invalid_utf8( $text ); 
  3. $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES ); 
  4. return apply_filters( 'esc_html', $safe_text, $text ); 
  5. return $text;