@@ 1617-1631 (lines=15) @@ | ||
1614 | * |
|
1615 | * @since 2.0.0 |
|
1616 | */ |
|
1617 | function kses_init_filters() { |
|
1618 | // Normal filtering |
|
1619 | add_filter('title_save_pre', 'wp_filter_kses'); |
|
1620 | ||
1621 | // Comment filtering |
|
1622 | if ( current_user_can( 'unfiltered_html' ) ) |
|
1623 | add_filter( 'pre_comment_content', 'wp_filter_post_kses' ); |
|
1624 | else |
|
1625 | add_filter( 'pre_comment_content', 'wp_filter_kses' ); |
|
1626 | ||
1627 | // Post filtering |
|
1628 | add_filter('content_save_pre', 'wp_filter_post_kses'); |
|
1629 | add_filter('excerpt_save_pre', 'wp_filter_post_kses'); |
|
1630 | add_filter('content_filtered_save_pre', 'wp_filter_post_kses'); |
|
1631 | } |
|
1632 | ||
1633 | /** |
|
1634 | * Removes all Kses input form content filters. |
|
@@ 1645-1657 (lines=13) @@ | ||
1642 | * |
|
1643 | * @since 2.0.6 |
|
1644 | */ |
|
1645 | function kses_remove_filters() { |
|
1646 | // Normal filtering |
|
1647 | remove_filter('title_save_pre', 'wp_filter_kses'); |
|
1648 | ||
1649 | // Comment filtering |
|
1650 | remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); |
|
1651 | remove_filter( 'pre_comment_content', 'wp_filter_kses' ); |
|
1652 | ||
1653 | // Post filtering |
|
1654 | remove_filter('content_save_pre', 'wp_filter_post_kses'); |
|
1655 | remove_filter('excerpt_save_pre', 'wp_filter_post_kses'); |
|
1656 | remove_filter('content_filtered_save_pre', 'wp_filter_post_kses'); |
|
1657 | } |
|
1658 | ||
1659 | /** |
|
1660 | * Sets up most of the Kses filters for input form content. |