WordPress.org

Make WordPress Core

Changeset 4653


Ignore:
Timestamp:
12/21/2006 01:54:15 AM (15 years ago)
Author:
ryan
Message:

kses function reorg to match trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/kses.php

    r4533 r4653  
    525525
    526526function kses_init_filters() {
    527         add_filter('pre_comment_author', 'wp_filter_kses');
    528         add_filter('pre_comment_content', 'wp_filter_kses');
    529         add_filter('content_save_pre', 'wp_filter_post_kses');
    530         add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
    531         add_filter('title_save_pre', 'wp_filter_kses');
     527    // Normal filtering.
     528    add_filter('pre_comment_content', 'wp_filter_kses');
     529    add_filter('title_save_pre', 'wp_filter_kses');
     530
     531    // Post filtering
     532    add_filter('content_save_pre', 'wp_filter_post_kses');
     533    add_filter('excerpt_save_pre', 'wp_filter_post_kses');
     534    add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
    532535}
    533536
     537function kses_remove_filters() {
     538    // Normal filtering.
     539    remove_filter('pre_comment_content', 'wp_filter_kses');
     540    remove_filter('title_save_pre', 'wp_filter_kses');
     541
     542    // Post filtering
     543    remove_filter('content_save_pre', 'wp_filter_post_kses');
     544    remove_filter('excerpt_save_pre', 'wp_filter_post_kses');
     545    remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
     546}
     547
    534548function kses_init() {
    535     remove_filter('pre_comment_author', 'wp_filter_kses');
    536     remove_filter('pre_comment_content', 'wp_filter_kses');
    537     remove_filter('content_save_pre', 'wp_filter_post_kses');
    538     remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
    539     remove_filter('title_save_pre', 'wp_filter_kses');
     549    kses_remove_filters();
    540550
    541551    if (current_user_can('unfiltered_html') == false)
    542552        kses_init_filters();
    543553}
     554
    544555add_action('init', 'kses_init');
    545556add_action('set_current_user', 'kses_init');
Note: See TracChangeset for help on using the changeset viewer.