wp_custom_css_kses_init_filters()WP 7.0.0

Adds the filters to strip custom CSS from block content on save. Priority of 8 to run before wp_filter_global_styles_post (priority 9) and wp_filter_post_kses (priority 10).

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

null. Nothing (null).

Usage

wp_custom_css_kses_init_filters();

Changelog

Since 7.0.0 Introduced.

wp_custom_css_kses_init_filters() code WP 7.0

function wp_custom_css_kses_init_filters() {
	add_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
	add_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
}