Filter hook 'esc_textarea'

in WP Core File wp-includes/formatting.php at line 4733

View Source

esc_textarea

Filter Hook
Description
Filters a string cleaned and escaped for output in a textarea element.

Hook Information

File Location wp-includes/formatting.php View on GitHub
Hook Type Filter
Line Number 4733

Hook Parameters

Type Name Description
string $safe_text The text after it has been escaped.
string $text The text prior to being escaped.

Usage Examples

Basic Usage
<?php
// Hook into esc_textarea
add_filter('esc_textarea', 'my_custom_filter', 10, 2);

function my_custom_filter($safe_text, $text) {
    // Your custom filtering logic here
    return $safe_text;
}

Source Code Context

wp-includes/formatting.php:4733 - How this hook is used in WordPress core
<?php
4728  	 * @since 3.1.0
4729  	 *
4730  	 * @param string $safe_text The text after it has been escaped.
4731  	 * @param string $text      The text prior to being escaped.
4732  	 */
4733  	return apply_filters( 'esc_textarea', $safe_text, $text );
4734  }
4735  
4736  /**
4737   * Escaping for XML blocks.
4738   *

PHP Documentation

<?php
/**
	 * Filters a string cleaned and escaped for output in a textarea element.
	 *
	 * @since 3.1.0
	 *
	 * @param string $safe_text The text after it has been escaped.
	 * @param string $text      The text prior to being escaped.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/formatting.php
Related Hooks

Related hooks will be displayed here in future updates.