wp_filter_kses( string $data )

Sanitize content with allowed HTML KSES rules.

Description Description

This function expects slashed data.

Top ↑

Parameters Parameters


(string) (Required) Content to filter, expected to be escaped with slashes.

Top ↑

Return Return

(string) Filtered content.

Top ↑

More Information More Information

wp_filter_kses should generally be preferred over wp_kses_data because wp_magic_quotes escapes $_GET, $_POST, $_COOKIE, $_SERVER, and $_REQUEST fairly early in the hook system, shortly after ‘plugins_loaded’ but earlier then ‘init’ or ‘wp_loaded’.

Top ↑

Source Source

File: wp-includes/kses.php

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

Top ↑

Changelog Changelog

Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.