kses_init() WordPress Function

The kses_init() function is a security measure implemented in WordPress that strips dangerous content from user-submitted data. It is important to note that kses does not remove all potential threats, but is a good first line of defense against malicious code.

kses_init() #

Sets up most of the KSES filters for input form content.


Description

First removes all of the KSES filters in case the current user does not need to have KSES filter the content. If the user does not have unfiltered_html capability, then KSES filters are added.


Top ↑

Source

File: wp-includes/kses.php

function kses_init() {
	kses_remove_filters();

	if ( ! current_user_can( 'unfiltered_html' ) ) {
		kses_init_filters();
	}
}


Top ↑

Changelog

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