wp_kses

Advertisement

Summery Summery

Filters text content and strips out disallowed HTML.

Syntax Syntax

wp_kses( string $string, array[]|string $allowed_html, string[] $allowed_protocols = array() )

Description Description

This function makes sure that only the allowed HTML element names, attribute names, attribute values, and HTML entities will occur in the given text string.

This function expects unslashed data.

Parameters Parameters

$string

(string) (Required) Text content to filter.

$allowed_html

(array[]|string) (Required) An array of allowed HTML elements and attributes, or a context name such as 'post'.

$allowed_protocols

(string[]) (Optional) Array of allowed URL protocols.

Default value: array()

Return Return

(string) Filtered content containing only the allowed HTML.

Source Source

File: wp-includes/kses.php


			

Advertisement

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

See also See also

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.