WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp kses split2

Description

Callback for wp_kses_split() for fixing malformed HTML tags.

This function does a lot of work. It rejects some very malformed things like <:::>. It returns an empty string, if the element isn't allowed (look ma, no strip_tags()!). Otherwise it splits the tag into an element and an attribute list.

After the tag is split into an element and an attribute list, it is run through another filter which will remove illegal attributes and once that is completed, will be returned.

Usage

<?php wp_kses_split2$string$allowed_html$allowed_protocols ?>

Parameters

$string
(string) (required) Content to filter
Default: None
$allowed_html
(array) (required) Allowed HTML elements
Default: None
$allowed_protocols
(array) (required) Allowed protocols to keep
Default: None

Return Values

(string) 
Fixed HTML element

Examples

Notes

  • This is a private function. It should not be called directly. It is listed in the Codex for completeness.
  • Uses: wp_kses_attr()

Change Log

Since: 1.0.0

Source File

wp_kses_split2() is located in wp-includes/kses.php.

Related

See also index of Function Reference and index of Template Tags.