kses_init_filters()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
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’.
Оригинал (английский)
All hooks have default priority. The wp_filter_kses() function is added to the ‘pre_comment_content’ and ‘title_save_pre’ hooks.
The wp_filter_post_kses() function is added to the ‘content_save_pre’, ‘excerpt_save_pre’, and ‘content_filtered_save_pre’ hooks.
Исходный код
wp-includes/kses.php:2462
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. |

