@@ 1623-1637 (lines=15) @@ | ||
1620 | * |
|
1621 | * @since 2.0.0 |
|
1622 | */ |
|
1623 | function kses_init_filters() { |
|
1624 | // Normal filtering |
|
1625 | add_filter('title_save_pre', 'wp_filter_kses'); |
|
1626 | ||
1627 | // Comment filtering |
|
1628 | if ( current_user_can( 'unfiltered_html' ) ) |
|
1629 | add_filter( 'pre_comment_content', 'wp_filter_post_kses' ); |
|
1630 | else |
|
1631 | add_filter( 'pre_comment_content', 'wp_filter_kses' ); |
|
1632 | ||
1633 | // Post filtering |
|
1634 | add_filter('content_save_pre', 'wp_filter_post_kses'); |
|
1635 | add_filter('excerpt_save_pre', 'wp_filter_post_kses'); |
|
1636 | add_filter('content_filtered_save_pre', 'wp_filter_post_kses'); |
|
1637 | } |
|
1638 | ||
1639 | /** |
|
1640 | * Removes all Kses input form content filters. |
|
@@ 1651-1663 (lines=13) @@ | ||
1648 | * |
|
1649 | * @since 2.0.6 |
|
1650 | */ |
|
1651 | function kses_remove_filters() { |
|
1652 | // Normal filtering |
|
1653 | remove_filter('title_save_pre', 'wp_filter_kses'); |
|
1654 | ||
1655 | // Comment filtering |
|
1656 | remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); |
|
1657 | remove_filter( 'pre_comment_content', 'wp_filter_kses' ); |
|
1658 | ||
1659 | // Post filtering |
|
1660 | remove_filter('content_save_pre', 'wp_filter_post_kses'); |
|
1661 | remove_filter('excerpt_save_pre', 'wp_filter_post_kses'); |
|
1662 | remove_filter('content_filtered_save_pre', 'wp_filter_post_kses'); |
|
1663 | } |
|
1664 | ||
1665 | /** |
|
1666 | * Sets up most of the Kses filters for input form content. |