# kses_init_filters()

URL: https://chugunov.pro/api-wordpress/functions/kses_init_filters/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.0.0.

## Сигнатура

```php
kses_init_filters()
```

## Описание

Все хуки имеют приоритет по умолчанию. Функция wp_filter_kses() добавляется к хукам ‘pre_comment_content’ и ‘title_save_pre’.
Функция wp_filter_post_kses() добавляется к хукам ‘content_save_pre’, ‘excerpt_save_pre’ и ‘content_filtered_save_pre’.

## Исходный код

Файл: `wp-includes/kses.php:2462`

```php
function kses_init_filters() {
	// Normal filtering.
	add_filter( 'title_save_pre', 'wp_filter_kses' );

	// Comment filtering.
	if ( current_user_can( 'unfiltered_html' ) ) {
		add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
	} else {
		add_filter( 'pre_comment_content', 'wp_filter_kses' );
	}

	// Global Styles filtering: Global Styles filters should be executed before normal post_kses HTML filters.
	add_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
	add_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );

	// Post filtering.
	add_filter( 'content_save_pre', 'wp_filter_post_kses' );
	add_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
	add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
}
```

## История изменений

- 2.0.0 — Introduced.

## Связанные

Использует: [`current_user_can`](https://chugunov.pro/api-wordpress/functions/current_user_can/), [`add_filter`](https://chugunov.pro/api-wordpress/functions/add_filter/).
Используется в: [`wp_handle_comment_submission`](https://chugunov.pro/api-wordpress/functions/wp_handle_comment_submission/), [`wp_ajax_replyto_comment`](https://chugunov.pro/api-wordpress/functions/wp_ajax_replyto_comment/), [`kses_init`](https://chugunov.pro/api-wordpress/functions/kses_init/), `WP_Embed::shortcode`, [`do_shortcode`](https://chugunov.pro/api-wordpress/functions/do_shortcode/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/kses_init_filters/
