wp_filter_post_kses( 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 slashed data.


Top ↑

Parameters

$data string Required
Post content to filter, expected to be escaped with slashes.

Top ↑

Return

string Filtered post content with allowed HTML tags and attributes intact.


Top ↑

Source

File: wp-includes/kses.php. View all references

function wp_filter_post_kses( $data ) {
	return addslashes( wp_kses( stripslashes( $data ), 'post' ) );
}


Top ↑

Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.