mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Add kses_init_filters(). Call it when running importers.
git-svn-id: https://develop.svn.wordpress.org/trunk@2934 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -513,15 +513,18 @@ function wp_filter_post_kses($data) {
|
||||
return addslashes ( wp_kses(stripslashes( $data ), $allowedposttags) );
|
||||
}
|
||||
|
||||
function kses_init_filters() {
|
||||
add_filter('pre_comment_author', 'wp_filter_kses');
|
||||
add_filter('pre_comment_content', 'wp_filter_kses');
|
||||
add_filter('content_save_pre', 'wp_filter_post_kses');
|
||||
}
|
||||
|
||||
function kses_init() {
|
||||
global $current_user;
|
||||
|
||||
get_currentuserinfo(); // set $current_user
|
||||
if (current_user_can('unfiltered_html') == false) {
|
||||
add_filter('pre_comment_author', 'wp_filter_kses');
|
||||
add_filter('pre_comment_content', 'wp_filter_kses');
|
||||
add_filter('content_save_pre', 'wp_filter_post_kses');
|
||||
}
|
||||
if (current_user_can('unfiltered_html') == false)
|
||||
kses_init_filters();
|
||||
}
|
||||
add_action('init', 'kses_init');
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user