# esc_textarea()

URL: https://chugunov.pro/api-wordpress/functions/esc_textarea/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.1.0.

## Сигнатура

```php
esc_textarea( string $text ): string
```

## Описание

Экранирование для значений textarea.

## Параметры

- `$text` `string` — обязательный

## Возвращаемое значение

`string`

## Исходный код

Файл: `wp-includes/formatting.php:4730`

```php
function esc_textarea( $text ) {
	$safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
	/**
	 * 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.
	 */
	return apply_filters( 'esc_textarea', $safe_text, $text );
}
```

## История изменений

- 3.1.0 — Introduced.

## Связанные

Использует: [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`get_option`](https://chugunov.pro/api-wordpress/functions/get_option/).
Используется в: `WP_Widget_Block::form`, `WP_Widget_Custom_HTML::form`, [`print_embed_sharing_dialog`](https://chugunov.pro/api-wordpress/functions/print_embed_sharing_dialog/), [`network_step2`](https://chugunov.pro/api-wordpress/functions/network_step2/), [`get_inline_data`](https://chugunov.pro/api-wordpress/functions/get_inline_data/), [`_list_meta_row`](https://chugunov.pro/api-wordpress/functions/_list_meta_row/), `WP_Comments_List_Table::column_comment`, `Walker_Nav_Menu_Edit::start_el`, [`format_to_edit`](https://chugunov.pro/api-wordpress/functions/format_to_edit/), `WP_Widget_Text::form`, `WP_Customize_Control::render_content`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/esc_textarea/
