WPDev.one
Core Function
View Source on Trac ↗

wp_kses_attr()

wp_kses_attr( mixed $element, mixed $attr, mixed $allowed_html, mixed $allowed_protocols )

Removes all attributes, if none are allowed for this element.

Parameters 4 required

Name / Type Description
$element
string

HTML element/tag.

Required
$attr
string

HTML attributes from HTML element to closing HTML element tag.

Required
mixed

(array[] | string) $allowed_html An array of allowed HTML elements and attributes, or a context name such as 'post'. See wp_kses_allowed_html() for the list of accepted context names.

Required
$allowed_protocols
string[]

Array of allowed URL protocols.

Required

Return Value

(string)
Sanitized HTML element.

Function Information

Since Version
1.0.0
Source File
wp-includes/kses.php
Advertisement