Languages: English • kses data 日本語 (Add your language)
Sanitize content with allowed HTML Kses rules.
<?php wp_kses_data( $data ); ?>
Below example sanitizes input HTML string by removing non allowed tag <div> and <script>.
<?php $s = '<div id="1st"><strong><i>Foo</i></strong><script>alert("Bar");</script></div>'; $x = wp_kses_data($s); // Now, $x is <strong><i>Foo</i></strong>alert("Bar"); ?>
Since: 2.9
wp_kses_data() is located in wp-includes/kses.php