mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Block Editor: Improve Global Styles filtering order.
From the conceptual point it makes sense to execute global styles filters before post filters. So the post filters are always the last. Props xknown, sergey, audrasjb, vortfu, oandregal, get_dave. Built from https://develop.svn.wordpress.org/trunk@52895 git-svn-id: http://core.svn.wordpress.org/trunk@52484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8cda35ebd3
commit
28b6093061
@ -2201,12 +2201,14 @@ function kses_init_filters() {
|
||||
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( 'content_save_pre', 'wp_filter_global_styles_post' );
|
||||
add_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
|
||||
add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
|
||||
add_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post' );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2229,12 +2231,14 @@ function kses_remove_filters() {
|
||||
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( 'content_save_pre', 'wp_filter_global_styles_post' );
|
||||
remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
|
||||
remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
|
||||
remove_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-alpha-52846';
|
||||
$wp_version = '6.0-alpha-52895';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user