wp_kses_post
Sanitize content for allowed HTML tags for post content.
Description
(string) wp_kses_post( (string) $data );
Post content refers to the page contents of the post type and not $_POST
data from forms.
Returns (string)
Filtered post content with allowed HTML tags and attributes intact.
Parameters (1)
- 0. $data (string)
- Post content to filter
Usage
if ( !function_exists( 'wp_kses_post' ) ) { require_once ABSPATH . WPINC . '/kses.php'; } // Post content to filter $data = ''; // NOTICE! Understand what this does before running. $result = wp_kses_post($data);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/kses.php
- function wp_kses_post( $data ) {
- return wp_kses( $data, 'post' );
- }