On this page
kses_remove_filters()
Removes all KSES input form content filters.
Description
A quick procedural method to removing all of the filters that KSES uses for content in WordPress Loop.
Does not remove the kses_init() function from ‘init’ hook (priority is default). Also does not remove kses_init() function from ‘set_current_user’ hook (priority is also default).
Source
File: wp-includes/kses.php. View all references
function kses_remove_filters() {
// Normal filtering.
remove_filter( 'title_save_pre', 'wp_filter_kses' );
// Comment filtering.
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
// Global Styles filtering.
remove_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
remove_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );
// Post filtering.
remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
}
Related
Uses
| Uses | Description |
|---|---|
| remove_filter() wp-includes/plugin.php | Removes a callback function from a filter hook. |
Used By
| Used By | Description |
|---|---|
| wp_handle_comment_submission() wp-includes/comment.php | Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form. |
| wp_ajax_replyto_comment() wp-admin/includes/ajax-actions.php | Ajax handler for replying to a comment. |
| kses_init() wp-includes/kses.php | Sets up most of the KSES filters for input form content. |
| WP_Embed::shortcode() wp-includes/class-wp-embed.php | The do_shortcode() callback function. |
Changelog
| Version | Description |
|---|---|
| 2.0.6 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/kses_remove_filters