wp_kses_split2


wp_kses_split2 ( $string, $allowed_html, $allowed_protocols )

Access:
  • private
Parameters:
  • (string) $string Content to filter.
  • (array) $allowed_html Allowed HTML elements.
  • (string[]) $allowed_protocols Array of allowed URL protocols.
Returns:
  • (string) Fixed HTML element
Defined at:

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.

Related Functions

wp_kses_split, wp_kses_post, _wp_kses_split_callback, wp_kses_version, wp_kses_hair

Top Google Results

User discussions

wpseek mobile