sanitize_text_field WordPress Filter Hook

The sanitize_text_field hook is used to clean up data before it is saved to the database. This is a great hook to use when you want to make sure that data is clean and safe before it is stored.

apply_filters( 'sanitize_text_field', string $filtered, string $str ) #

Filters a sanitized text field string.


Parameters

$filtered

(string)The sanitized string.

$str

(string)The string prior to being sanitized.


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More