WPDev.one

wp_kses()

wp_kses( mixed $content, mixed $allowed_html, mixed $allowed_protocols = array() )

Filters text content and strips out disallowed HTML.

Parameters 3 required

Name / Type Description
$content
string

Text content to filter.

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
string[]

$allowed_protocols Optional. Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().

Required

Return Value

(string)
Filtered content containing only the allowed HTML.

Function Information

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