Add kses_init_filters(). Call it when running importers.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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