esc_textarea

Escaping for textarea values.

Description

(string) esc_textarea( (string) $text ); 

Returns (string)

Parameters (1)

0. $text (string)
The text.

Usage

  1. if ( !function_exists( 'esc_textarea' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // The text. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = esc_textarea($text); 
  9.  

Defined (1)

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

/wp-includes/formatting.php  
  1. function esc_textarea( $text ) { 
  2. $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) ); 
  3. /** 
  4. * Filters a string cleaned and escaped for output in a textarea element. 
  5. * @since 3.1.0 
  6. * @param string $safe_text The text after it has been escaped. 
  7. * @param string $text The text prior to being escaped. 
  8. */ 
  9. return apply_filters( 'esc_textarea', $safe_text, $text );