wp_kses_data( string $data ): string
Sanitize content with allowed HTML KSES rules.
Description
This function expects unslashed data.
Parameters
-
$data
string Required -
Content to filter, expected to not be escaped.
Return
string Filtered content.
Source
File: wp-includes/kses.php
.
View all references
function wp_kses_data( $data ) {
return wp_kses( $data, current_filter() );
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example
Below example sanitizes input HTML string by removing non allowed tag <div> and <script>.