wp_kses_data() WordPress Function

The wp_kses_data() function is used to filter post data. It allows for kses rules to be applied to the data to remove unwanted content. This function can be useful for ensuring that only certain HTML tags and attributes are allowed in a post.

wp_kses_data( string $data ) #

Sanitize content with allowed HTML KSES rules.


Description

This function expects unslashed data.


Top ↑

Parameters

$data

(string)(Required)Content to filter, expected to not be escaped.


Top ↑

Return

(string) Filtered content.


Top ↑

Source

File: wp-includes/kses.php

function wp_kses_data( $data ) {
	return wp_kses( $data, current_filter() );
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.