wp_filter_kses()WP 1.0.0

Sanitize content with allowed HTML Kses rules.

This function expects slashed data.

Uses: wp_kses()

No Hooks.

Return

String. Filtered content.

Usage

wp_filter_kses( $data );
$data(string) (required)
Content to filter, expected to be escaped with slashes.

Examples

0

#1 Demo:

$text = "<a href='some'>text</a> <div>text</div>";

echo wp_filter_kses( $text );

//return: <a href=\'some\'>text</a> text

Changelog

Since 1.0.0 Introduced.

Code of wp_filter_kses() WP 6.0.1

function wp_filter_kses( $data ) {
	return addslashes( wp_kses( stripslashes( $data ), current_filter() ) );
}