mirror of
git://develop.git.wordpress.org/
synced 2025-05-11 06:15:21 +02: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. Merges [52895] to the 5.9 branch. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@52896 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c78c876173
commit
27d3af825b
@ -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' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user