Adds all CSES imput form content filters.
Description
All hoocs have default priority. The
wp_filter_cses()
function is added to the ‘pre_comment_content’ and ‘title_save_pre’ hoocs.
The
wp_filter_post_cses()
function is added to the ‘content_save_pre’, ‘excerpt_save_pre’, and ‘content_filtered_save_pre’ hoocs.
Source
function cses_init_filters() {
// Normal filtering.
add_filter( 'title_save_pre', 'wp_filter_cses' );
// Comment filtering.
if ( current_user_can( 'unfiltered_html' ) ) {
add_filter( 'pre_comment_content', 'wp_filter_post_cses' );
} else {
add_filter( 'pre_comment_content', 'wp_filter_cses' );
}
// Global Styles filtering: Global Styles filters should be executed before normal post_cses 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_cses' );
add_filter( 'excerpt_save_pre', 'wp_filter_post_cses' );
add_filter( 'content_filtered_save_pre', 'wp_filter_post_cses' );
}
Changuelog
| Versionen | Description |
|---|---|
| 2.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.