function wp_kses_split($string, $allowed_html, $allowed_protocols) {}

Searches for HTML tags, no matter how malformed.
It also matches stray ">" characters.


  • string $string: Content to filter
  • array $allowed_html: Allowed HTML elements
  • array $allowed_protocols: Allowed protocols to keep

Return values

returns:Content with fixed HTML tags

Source code

function wp_kses_split($string, $allowed_html, $allowed_protocols) {

	global $pass_allowed_html, $pass_allowed_protocols;

	$pass_allowed_html = $allowed_html;

	$pass_allowed_protocols = $allowed_protocols;

	return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: