wp_filter_nohtml_kses() WordPress Function

The wp_filter_nohtml_kses() function is a built-in Wordpress function that strips all HTML tags from a string. This function is typically used to sanitize user-provided input before saving it to the database.

wp_filter_nohtml_kses( string $data ) #

Strips all HTML from a text string.


Description

This function expects slashed data.


Top ↑

Parameters

$data

(string)(Required)Content to strip all HTML from.


Top ↑

Return

(string) Filtered content without any HTML.


Top ↑

Source

File: wp-includes/kses.php

function wp_filter_nohtml_kses( $data ) {
	return addslashes( wp_kses( stripslashes( $data ), 'strip' ) );
}


Top ↑

Changelog

Changelog
VersionDescription
2.1.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.