On this page
esc_textarea( string $text ): string
Escaping for textarea values.
Parameters
$textstring Required
Return
string
Source
File: wp-includes/formatting.php. View all references
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 );
}
Hooks
- apply_filters( 'esc_textarea',
string $safe_text ,string $text ) -
Filters a string cleaned and escaped for output in a textarea element.
Related
Uses
| Uses | Description |
|---|---|
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| get_option() wp-includes/option.php | Retrieves an option value based on an option name. |
Used By
| Used By | Description |
|---|---|
| WP_Widget_Block::form() wp-includes/widgets/class-wp-widget-block.php | Outputs the Block widget settings form. |
| WP_Widget_Custom_HTML::form() wp-includes/widgets/class-wp-widget-custom-html.php | Outputs the Custom HTML widget settings form. |
| print_embed_sharing_dialog() wp-includes/embed.php | Prints the necessary markup for the embed sharing dialog. |
| network_step2() wp-admin/includes/network.php | Prints step 2 for Network installation process. |
| get_inline_data() wp-admin/includes/template.php | Adds hidden fields with the data for use in the inline editor for posts and pages. |
| _list_meta_row() wp-admin/includes/template.php | Outputs a single row of public meta data in the Custom Fields meta box. |
| WP_Comments_List_Table::column_comment() wp-admin/includes/class-wp-comments-list-table.php | |
| format_to_edit() wp-includes/formatting.php | Acts on text which is about to be edited. |
| WP_Widget_Text::form() wp-includes/widgets/class-wp-widget-text.php | Outputs the Text widget settings form. |
| WP_Customize_Control::render_content() wp-includes/class-wp-customize-control.php | Render the control’s content. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/esc_textarea