On this page
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
$datastring 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' );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_kses() wp-includes/kses.php | Filters text content and strips out disallowed HTML. |
Used By
| Used By | Description |
|---|---|
| WP_Site_Health::get_test_page_cache() wp-admin/includes/class-wp-site-health.php | Tests if a full page cache is available. |
| WP_Widget_Block::update() wp-includes/widgets/class-wp-widget-block.php | Handles updating settings for the current Block widget instance. |
| WP_REST_Pattern_Directory_Controller::prepare_item_for_response() wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Prepare a raw block pattern before it gets output in a REST API response. |
| WP_Widget_Custom_HTML::update() wp-includes/widgets/class-wp-widget-custom-html.php | Handles updating settings for the current Custom HTML widget instance. |
| do_settings_sections() wp-admin/includes/template.php | Prints out all settings sections added to a particular settings page. |
| wp_add_id3_tag_data() wp-admin/includes/media.php | Parses ID3v2, ID3v1, and getID3 comments to extract usable data. |
| WP_Widget_Text::update() wp-includes/widgets/class-wp-widget-text.php | Handles updating settings for the current Text widget instance. |
| WP_SimplePie_Sanitize_KSES::sanitize() wp-includes/class-wp-simplepie-sanitize-kses.php | WordPress SimplePie sanitization using KSES. |
| WP_Customize_Widgets::sanitize_widget_instance() wp-includes/class-wp-customize-widgets.php | Sanitizes a widget instance. |
Changelog
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_kses_post