pre_kses
Filter HookDescription
Filters content to be run through KSES.Hook Information
File Location |
wp-includes/kses.php
View on GitHub
|
Hook Type | Filter |
Line Number | 948 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$content
|
Content to filter through KSES. |
array[]|string
|
$allowed_html
|
An array of allowed HTML elements and attributes, or a context name such as 'post'. See wp_kses_allowed_html() for the list of accepted context names. |
string[]
|
$allowed_protocols
|
Array of allowed URL protocols. |
Usage Examples
Basic Usage
<?php
// Hook into pre_kses
add_filter('pre_kses', 'my_custom_filter', 10, 3);
function my_custom_filter($content, $allowed_html, $allowed_protocols) {
// Your custom filtering logic here
return $content;
}
Source Code Context
wp-includes/kses.php:948
- How this hook is used in WordPress core
<?php
943 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes,
944 * or a context name such as 'post'. See wp_kses_allowed_html()
945 * for the list of accepted context names.
946 * @param string[] $allowed_protocols Array of allowed URL protocols.
947 */
948 return apply_filters( 'pre_kses', $content, $allowed_html, $allowed_protocols );
949 }
950
951 /**
952 * Returns the version number of KSES.
953 *
PHP Documentation
<?php
/**
* Filters content to be run through KSES.
*
* @since 2.3.0
*
* @param string $content Content to filter through KSES.
* @param array[]|string $allowed_html An array of allowed HTML elements and attributes,
* or a context name such as 'post'. See wp_kses_allowed_html()
* for the list of accepted context names.
* @param string[] $allowed_protocols Array of allowed URL protocols.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/kses.php
Related Hooks
Related hooks will be displayed here in future updates.