wp_kses_post( string $data ): string
Sanitizes content for allowed HTML tags for post content.
Description
Post content refers to the page contents of the ‘post’ type and not $_POST
data from forms.
This function expects unslashed data.
Parameters
-
$data
string Required -
Post content to filter.
Return
string Filtered post content with allowed HTML tags and attributes intact.
Source
File: wp-includes/kses.php
.
View all references
function wp_kses_post( $data ) {
return wp_kses( $data, 'post' );
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Display Admin notice
The following example of basic usage of the
wp_kses_post()
function. We can use it to print the message in the admin screen.