Uses
Uses | Description |
---|---|
wp-includes/kses.php: wp_kses() | Filters text content and strips out disallowed HTML. |
wp-includes/plugin.php: current_filter() | Retrieve the name of the current filter or action. |
Sanitize content with allowed HTML KSES rules.
This function expects slashed data.
(string) (Required) Content to filter, expected to be escaped with slashes.
(string) Filtered content.
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’.
File: wp-includes/kses.php
function wp_filter_kses( $data ) { return addslashes( wp_kses( stripslashes( $data ), current_filter() ) ); }
Version | Description |
---|---|
1.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_filter_kses